diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 3e9dd6af7f..0a5c0e2d0a 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -718,6 +718,8 @@ static int amf_skip_tag(AVIOContext *pb, AMFDataType type, int depth) parse_name = 0; case AMF_DATA_TYPE_MIXEDARRAY: nb = avio_rb32(pb); + if (nb < 0) + return AVERROR_INVALIDDATA; case AMF_DATA_TYPE_OBJECT: while(!pb->eof_reached && (nb-- > 0 || type != AMF_DATA_TYPE_ARRAY)) { if (parse_name) {