1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

libavcodec/mpeg12dec.c: Switch to init_get_bits8 and checks return value

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Thierry Foucu 2021-07-27 11:25:04 -07:00 committed by Michael Niedermayer
parent 0068b3d0f0
commit fc300613be

View File

@ -1340,9 +1340,11 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf,
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int ref, f_code, vbv_delay;
int ref, f_code, vbv_delay, ret;
init_get_bits(&s->gb, buf, buf_size * 8);
ret = init_get_bits8(&s->gb, buf, buf_size);
if (ret < 0)
return ret;
ref = get_bits(&s->gb, 10); /* temporal ref */
s->pict_type = get_bits(&s->gb, 3);