summaryrefslogtreecommitdiff
path: root/libavcodec/rv10.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-18 00:03:08 +0200
committerReinhard Tartler <siretart@tauware.de>2011-09-26 19:26:33 +0200
commit28d948ac44e38e8bec2f6268ccf4747ff4d992a9 (patch)
tree0e8f239d0a26ed6116be75fdb6701d0e9cb57d67 /libavcodec/rv10.c
parent9973ca992e8499848b8d5b0b536e709109dc65e2 (diff)
downloadffmpeg-28d948ac44e38e8bec2f6268ccf4747ff4d992a9.tar.gz
rv10: Reject slices that does not have the same type as the first one
This prevents crashes with some corrupted bitstreams. Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit 4a29b471869353c3077fb4b25b6518eb1047afb7) Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r--libavcodec/rv10.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 78f97b16b1..223500c356 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -543,6 +543,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->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);