diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-10-13 03:30:06 +0200 |
---|---|---|
committer | Sean McGovern <gseanmcg@gmail.com> | 2014-02-01 14:59:50 -0500 |
commit | c85e5f13f6ac9c4c90125e7671d89009e57f9df9 (patch) | |
tree | a0f9a82382020b5c714f6b0a1f0e2bae806e2abc /libavcodec | |
parent | 3485a07977f17b8d4709fb327be4fc29031032b7 (diff) | |
download | ffmpeg-c85e5f13f6ac9c4c90125e7671d89009e57f9df9.tar.gz |
cavs: Check for negative cbp
Sample-Id: 00000647-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/cavsdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 7cfb2ca21b..15a05c862d 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -602,8 +602,8 @@ static inline int decode_residual_inter(AVSContext *h) /* get coded block pattern */ int cbp = get_ue_golomb(&h->gb); - if (cbp > 63) { - av_log(h->avctx, AV_LOG_ERROR, "illegal inter cbp\n"); + if (cbp > 63 || cbp < 0) { + av_log(h->avctx, AV_LOG_ERROR, "illegal inter cbp %d\n", cbp); return -1; } h->cbp = cbp_tab[cbp][1]; @@ -673,7 +673,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) /* get coded block pattern */ if (h->cur.f->pict_type == AV_PICTURE_TYPE_I) cbp_code = get_ue_golomb(gb); - if (cbp_code > 63) { + if (cbp_code > 63 || cbp_code < 0) { av_log(h->avctx, AV_LOG_ERROR, "illegal intra cbp\n"); return -1; } |