[FFmpeg-cvslog] avcodec/smvjpegdec: assert that the pixel format that has been set by our decoder is valid
Michael Niedermayer
git at videolan.org
Sat Jun 13 01:04:54 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun 13 00:27:21 2015 +0200| [df037fe107ccfae4b26ee0e46b638b052f6e49f8] | committer: Michael Niedermayer
avcodec/smvjpegdec: assert that the pixel format that has been set by our decoder is valid
If we do check av_pix_fmt_desc_get() then we should fail and
not continue with an invalid pix_fmt
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df037fe107ccfae4b26ee0e46b638b052f6e49f8
---
libavcodec/smvjpegdec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 45faff2..9c2fb38 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -164,7 +164,9 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_siz
return AVERROR(EINVAL);
desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
- if (desc && mjpeg_data->height % (s->frames_per_jpeg << desc->log2_chroma_h)) {
+ av_assert0(desc);
+
+ if (mjpeg_data->height % (s->frames_per_jpeg << desc->log2_chroma_h)) {
av_log(avctx, AV_LOG_ERROR, "Invalid height\n");
return AVERROR_INVALIDDATA;
}
More information about the ffmpeg-cvslog
mailing list