[FFmpeg-cvslog] mjpegbdec: dont return a picture when there is no picture.

Michael Niedermayer git at videolan.org
Fri Nov 9 12:49:25 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov  9 12:43:51 2012 +0100| [909a18f73b30ed33495b9ee87114c0ed4fbd9cee] | committer: Michael Niedermayer

mjpegbdec: dont return a picture when there is no picture.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=909a18f73b30ed33495b9ee87114c0ed4fbd9cee
---

 libavcodec/mjpegbdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index 77f23f2..796ef84 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -136,6 +136,11 @@ read_header:
 
     //XXX FIXME factorize, this looks very similar to the EOI code
 
+    if(!s->got_picture) {
+        av_log(avctx, AV_LOG_WARNING, "no picture\n");
+        return buf_size;
+    }
+
     *picture= *s->picture_ptr;
     *data_size = sizeof(AVFrame);
 



More information about the ffmpeg-cvslog mailing list