diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-18 02:03:08 +0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-12-24 15:20:33 +0400 |
commit | 7cd7461ec8013a381938b52568f9eb08ab3d1720 (patch) | |
tree | de3551d29b023b4548aea4289ba5040a57a88783 /libavcodec | |
parent | 23f622de60d66b6e47c28493089566becd635426 (diff) |
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>
(cherry picked from commit 28d948ac44e38e8bec2f6268ccf4747ff4d992a9)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/rv10.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 7b635b3a1c..af0d16c022 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -559,6 +559,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; + } } dprintf(avctx, "qscale=%d\n", s->qscale); |