Commit 8e104619 authored by Vittorio Giovara's avatar Vittorio Giovara

shorten: check for return value

Avoid a possible negative bitshift.

CC: libav-stable@libav.org
Bug-Id: CID 1194400
parent d5d2d6c3
...@@ -510,6 +510,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, ...@@ -510,6 +510,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
break; break;
case FN_BITSHIFT: case FN_BITSHIFT:
s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE); s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
if (s->bitshift < 0)
return AVERROR_INVALIDDATA;
break; break;
case FN_BLOCKSIZE: { case FN_BLOCKSIZE: {
unsigned blocksize = get_uint(s, av_log2(s->blocksize)); unsigned blocksize = get_uint(s, av_log2(s->blocksize));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment