summaryrefslogtreecommitdiff
path: root/libavcodec/cavsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-10 23:28:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-11 03:02:51 +0200
commit7ea5dbcb83a502d8152d5c64d32f9a16e7e907c7 (patch)
tree6d18931d981f47fdcada02e14766b9fd26c1ce8e /libavcodec/cavsdec.c
parent00d516454c77a77d11c97099cba069030d82a7cb (diff)
cavsdec: Fix assertion failure.
The assert in decode_mb_b() is replaced by a normal error check for the case that can occur with a damaged or crafted bitstream. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cavsdec.c')
-rw-r--r--libavcodec/cavsdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 0f4f3acfa3..b0a18c46b9 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -820,7 +820,11 @@ static void decode_mb_b(AVSContext *h, enum cavs_mb mb_type) {
}
break;
default:
- av_assert2((mb_type > B_SYM_16X16) && (mb_type < B_8X8));
+ if (mb_type <= B_SYM_16X16) {
+ av_log(h->s.avctx, AV_LOG_ERROR, "Invalid mb_type %d in B frame\n", mb_type);
+ return AVERROR_INVALIDDATA;
+ }
+ av_assert2(mb_type < B_8X8);
flags = ff_cavs_partition_flags[mb_type];
if(mb_type & 1) { /* 16x8 macroblock types */
if(flags & FWD0)