aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2011-09-12 11:39:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-11-03 03:52:55 +0100
commitd8439f045220119d718968cf1023f5cd8182f877 (patch)
treea35743452658a26684c923235abce3c2b577db72
parenteb6b0ed8be31047002954abe659d2018a4ce3338 (diff)
downloadffmpeg-d8439f045220119d718968cf1023f5cd8182f877.tar.gz
rv34: check that subsequent slices have the same type as first one.
This prevents some crashes when corrupted bitstream reports e.g. P-type slice in I-frame. Official RealVideo decoder demands all slices to be of the same type too. Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit 23a1f0c59241465ba30103388029a7afc0ead909)
-rw-r--r--libavcodec/rv34.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 13415e0cd9..da20dbb10b 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1269,6 +1269,13 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
r->next_pts = r->cur_pts;
}
s->mb_x = s->mb_y = 0;
+ } else {
+ int slice_type = r->si.type ? r->si.type : FF_I_TYPE;
+
+ if (slice_type != s->pict_type) {
+ av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
+ return AVERROR_INVALIDDATA;
+ }
}
r->si.end = end;