[FFmpeg-cvslog] avcodec/hapdec: Check section_size for non negativity in parse_section_header()

Michael Niedermayer git at videolan.org
Sat Sep 5 00:48:08 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep  5 00:09:32 2015 +0200| [205c31b301864e675d051b07b19b6c457cf2ab24] | committer: Michael Niedermayer

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

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=205c31b301864e675d051b07b19b6c457cf2ab24
---

 libavcodec/hapdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c
index 3f036fd..6adac21 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;



More information about the ffmpeg-cvslog mailing list