diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 2cad21d459..5fbf89f61b 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -1115,6 +1115,8 @@ int ff_h263_decode_picture_header(MpegEncContext *s) /* PEI */ while (get_bits1(&s->gb) != 0) { skip_bits(&s->gb, 8); + if (get_bits_left(&s->gb) <= 0) + return AVERROR_INVALIDDATA; } if(s->h263_slice_structured){