Avoid a possible negative bitshift.
CC: libav-stable@libav.org
Bug-Id: CID 1194400
... | ... |
@@ -510,6 +510,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, |
510 | 510 |
break; |
511 | 511 |
case FN_BITSHIFT: |
512 | 512 |
s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE); |
513 |
+ if (s->bitshift < 0) |
|
514 |
+ return AVERROR_INVALIDDATA; |
|
513 | 515 |
break; |
514 | 516 |
case FN_BLOCKSIZE: { |
515 | 517 |
unsigned blocksize = get_uint(s, av_log2(s->blocksize)); |