diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-30 17:01:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-30 17:22:37 +0200 |
commit | 9d230ba924c907ebb9fd0ea3fa5fe98ba7153454 (patch) | |
tree | 73b612fdf876fdb5a6ce43298c9566114cf95758 /libavformat/nutdec.c | |
parent | b12e61ac7f3f1fdf47e5a5083242d2ba4096a1da (diff) | |
download | ffmpeg-9d230ba924c907ebb9fd0ea3fa5fe98ba7153454.tar.gz |
nutdec: check that filesize is valid before using it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/nutdec.c')
-rw-r--r-- | libavformat/nutdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index cd0dd94bf9..d19127ccea 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) { |