shorten: check for return value

Avoid a possible negative bitshift.

CC: libav-stable@libav.org
Bug-Id: CID 1194400
This commit is contained in:
Vittorio Giovara 2014-11-11 17:40:08 +01:00
parent d5d2d6c3b8
commit 8e104619a6
1 changed files with 2 additions and 0 deletions

View File

@ -510,6 +510,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
break;
case FN_BITSHIFT:
s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
if (s->bitshift < 0)
return AVERROR_INVALIDDATA;
break;
case FN_BLOCKSIZE: {
unsigned blocksize = get_uint(s, av_log2(s->blocksize));