aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cavsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-24 16:29:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-24 16:29:46 +0100
commit71e78e1f513ec7356b1a5011bbfc71fcd2fd391b (patch)
treed8954024ef8a5e640dbed72d211d9fc6e4de2fd1 /libavcodec/cavsdec.c
parent9a57a37b7041581c10629c8241260a5d7bfbc1e7 (diff)
downloadandroid_external_ffmpeg-71e78e1f513ec7356b1a5011bbfc71fcd2fd391b.tar.gz
android_external_ffmpeg-71e78e1f513ec7356b1a5011bbfc71fcd2fd391b.tar.bz2
android_external_ffmpeg-71e78e1f513ec7356b1a5011bbfc71fcd2fd391b.zip
cavsdec: check stc in decode_slice_header()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cavsdec.c')
-rw-r--r--libavcodec/cavsdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index daebda26fd..8f87d5abcd 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -418,6 +418,10 @@ static void decode_mb_b(AVSContext *h, enum cavs_mb mb_type) {
static inline int decode_slice_header(AVSContext *h, GetBitContext *gb) {
if(h->stc > 0xAF)
av_log(h->s.avctx, AV_LOG_ERROR, "unexpected start code 0x%02x\n", h->stc);
+
+ if (h->stc >= h->mb_height)
+ return -1;
+
h->mby = h->stc;
h->mbidx = h->mby*h->mb_width;