avcodec/mjpegdec: Dont skip picture allocation if theres no picture allocated
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jan 2014 15:44:58 +0000 (16:44 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 19 Jan 2014 16:30:22 +0000 (17:30 +0100)
Fixes Ticket 3245

libavcodec/mjpegdec.c

index 5eebec4..6a74226 100644 (file)
@@ -336,7 +336,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
         s->first_picture = 0;
     }
 
-    if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
+    if (s->got_picture && s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
         if (s->progressive) {
             avpriv_request_sample(s->avctx, "progressively coded interlaced picture");
             return AVERROR_INVALIDDATA;