[FFmpeg-devel] [PATCH 1/2] Reject slices that does not have the same type than the first one in RV10/RV20 decoder.

fenrir at elivagar.org fenrir at elivagar.org
Sun Sep 18 00:17:44 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

This prevents crashes with some corrupted bitstreams.
---
 libavcodec/rv10.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index d789eff..b659079 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -531,8 +531,12 @@ 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)
+            return -1;
     }
 
+
     av_dlog(avctx, "qscale=%d\n", s->qscale);
 
     /* default quantization values */
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list