From 205c31b301864e675d051b07b19b6c457cf2ab24 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 5 Sep 2015 00:09:32 +0200 Subject: [PATCH] avcodec/hapdec: Check section_size for non negativity in parse_section_header() Signed-off-by: Michael Niedermayer --- libavcodec/hapdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index 3f036fd690..6adac21bbb 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -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;