[FFmpeg-cvslog] nutdec: check that filesize is valid before using it.

Michael Niedermayer git at videolan.org
Sat Jun 30 17:23:42 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun 30 17:01:59 2012 +0200| [9d230ba924c907ebb9fd0ea3fa5fe98ba7153454] | committer: Michael Niedermayer

nutdec: check that filesize is valid before using it.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/nutdec.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index cd0dd94..d19127c 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -562,6 +562,9 @@ static int find_and_decode_index(NUTContext *nut)
     int8_t *has_keyframe;
     int ret = -1;
 
+    if(filesize <= 0)
+        return -1;
+
     avio_seek(bc, filesize - 12, SEEK_SET);
     avio_seek(bc, filesize - avio_rb64(bc), SEEK_SET);
     if (avio_rb64(bc) != INDEX_STARTCODE) {



More information about the ffmpeg-cvslog mailing list