Skip to content

Commit

Permalink
avcodec/mjpegbdec: use init_get_bits8()
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpl committed Sep 21, 2022
1 parent 6a150fc commit b9d71cd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libavcodec/mjpegbdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ static int mjpegb_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
s->restart_count = 0;
s->mjpb_skiptosod = 0;

if (buf_end - buf_ptr >= 1 << 28)
return AVERROR_INVALIDDATA;

init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8);
if ((ret = init_get_bits8(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr))) < 0)
return ret;

skip_bits(&hgb, 32); /* reserved zeros */

Expand Down

0 comments on commit b9d71cd

Please sign in to comment.