rv10: Reject slices that does not have the same type as the first one
authorLaurent Aimar <fenrir@videolan.org>
Sat, 17 Sep 2011 22:03:08 +0000 (00:03 +0200)
committerMartin Storsjö <martin@martin.st>
Mon, 19 Sep 2011 11:58:33 +0000 (14:58 +0300)
This prevents crashes with some corrupted bitstreams.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/rv10.c

index d789eff..3ba8102 100644 (file)
@@ -531,6 +531,11 @@ static int rv10_decode_packet(AVCodecContext *avctx,
         if(MPV_frame_start(s, avctx) < 0)
             return -1;
         ff_er_frame_start(s);
+    } else {
+        if (s->current_picture_ptr->f.pict_type != s->pict_type) {
+            av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
+            return -1;
+        }
     }
 
     av_dlog(avctx, "qscale=%d\n", s->qscale);