shorten: check for return value

Avoid a possible negative bitshift.

CC: libav-stable@libav.org
Bug-Id: CID 1194400
pull/97/head
Vittorio Giovara 10 years ago
parent d5d2d6c3b8
commit 8e104619a6
  1. 2
      libavcodec/shorten.c

@ -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));

Loading…
Cancel
Save