avcodec/smvjpegdec: assert that the pixel format that has been set by our decoder...
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jun 2015 22:27:21 +0000 (00:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jun 2015 22:51:29 +0000 (00:51 +0200)
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@gmx.at>
libavcodec/smvjpegdec.c

index 45faff2..9c2fb38 100644 (file)
@@ -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;
     }