avcodec/hapdec: Check section_size for non negativity in parse_section_header()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-09-05 00:09:32 +02:00
parent 0cdba4ac68
commit 205c31b301

View File

@ -61,7 +61,7 @@ static int parse_section_header(GetByteContext *gbc, int *section_size,
*section_size = bytestream2_get_le32(gbc);
}
if (*section_size > bytestream2_get_bytes_left(gbc))
if (*section_size > bytestream2_get_bytes_left(gbc) || *section_size < 0)
return AVERROR_INVALIDDATA;
else
return 0;