[FFmpeg-cvslog] cavs: Check for negative cbp
Luca Barbato
git at videolan.org
Tue Feb 4 06:11:07 CET 2014
ffmpeg | branch: release/1.1 | Luca Barbato <lu_zero at gentoo.org> | Sun Oct 13 03:30:06 2013 +0200| [c85e5f13f6ac9c4c90125e7671d89009e57f9df9] | committer: Sean McGovern
cavs: Check for negative cbp
Sample-Id: 00000647-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c85e5f13f6ac9c4c90125e7671d89009e57f9df9
---
libavcodec/cavsdec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 7cfb2ca..15a05c8 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;
}
More information about the ffmpeg-cvslog
mailing list