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) {