Fixes: assertion failure
Fixes: 
26813/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-5756269803339776

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavcodec/smvjpegdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 973a9117f2..67f346650c 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -173,9 +173,6 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void 
*data, int *data_siz
         return AVERROR_INVALIDDATA;
     }
 
-    /*use the last lot... */
-    *data_size = s->mjpeg_data_size;
-
     avctx->pix_fmt = s->avctx->pix_fmt;
 
     /* We shouldn't get here if frames_per_jpeg <= 0 because this was rejected
@@ -186,6 +183,9 @@ static int smvjpeg_decode_frame(AVCodecContext *avctx, void 
*data, int *data_siz
         return ret;
     }
 
+    /*use the last lot... */
+    *data_size = s->mjpeg_data_size;
+
     if (*data_size) {
         s->picture[1]->extended_data = NULL;
         s->picture[1]->width         = avctx->width;
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to