indeo: Reject impossible FRAMETYPE_NULL
authorLuca Barbato <lu_zero@gentoo.org>
Sun, 14 Jul 2013 16:16:56 +0000 (18:16 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 24 Aug 2013 10:11:57 +0000 (12:11 +0200)
A frame marked FRAMETYPE_NULL cannot be scalable and requires a
previous frame successfully decoded.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 5b2a29552ca09edd4646b6aa1828b32912b7ab36)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/ivi_common.c

index 36293a1..2a73754 100644 (file)
@@ -953,6 +953,14 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
                 }
             }
         }
+    } else {
+        if (ctx->is_scalable)
+            return AVERROR_INVALIDDATA;
+
+        for (p = 0; p < 3; p++) {
+            if (!ctx->planes[p].bands[0].buf)
+                return AVERROR_INVALIDDATA;
+        }
     }
 
     //STOP_TIMER("decode_planes"); }