X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fituh263dec.c;h=5e3c0eac0739d44a3df84f99b7cd1c57c5d50589;hb=f4c3aa7ade13cd3e52366ffc8801a55588027aeb;hp=a26244f3931450beeaee702fd4669ec1419fb69e;hpb=f761d4967053352f9b95ac2bc2505ea06d25a2a0;p=ffmpeg diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index a26244f3931..5e3c0eac073 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -167,6 +167,7 @@ static int h263_decode_gob_header(MpegEncContext *s) /* We have a GBSC probably with GSTUFF */ skip_bits(&s->gb, 16); /* Drop the zeros */ left= get_bits_left(&s->gb); + left = FFMIN(left, 32); //MN: we must check the bits left or we might end in an infinite loop (or segfault) for(;left>13; left--){ if(get_bits1(&s->gb)) break; /* Seek the '1' bit */