avcodec/leaddec: Check init_get_bits8() for failure

Fixes: CID1604416 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 6 months ago
parent 6e4c037833
commit 0e3e7e8aeb
  1. 4
      libavcodec/leaddec.c

@ -194,7 +194,9 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame,
i++;
}
init_get_bits8(&gb, s->bitstream_buf, size);
ret = init_get_bits8(&gb, s->bitstream_buf, size);
if (ret < 0)
return ret;
if (avctx->pix_fmt == AV_PIX_FMT_YUV420P && zero) {
for (int mb_y = 0; mb_y < avctx->height / 8; mb_y++)

Loading…
Cancel
Save