diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 9a2c8e6c42..09b6a2f17d 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -303,6 +303,10 @@ static int h263p_decode_umotion(MpegEncContext * s, int pred) { code <<= 1; code += get_bits1(&s->gb); + if (code >= 32768) { + avpriv_request_sample(s->avctx, "Huge DMV"); + return AVERROR_INVALIDDATA; + } } sign = code & 1; code >>= 1;