]> git.sesse.net Git - ffmpeg/commitdiff
lavf/wav: Read files >4G if no smaller filesize was written.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 16 May 2015 21:33:48 +0000 (23:33 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 17 May 2015 00:08:58 +0000 (02:08 +0200)
Fixes second part of ticket #4543.

libavformat/wavdec.c

index 410c2ec1f9be093c37461761b827a3e3ede07d3f..befc6646883165f9175afb4809eb802c6f3675d8 100644 (file)
@@ -335,9 +335,14 @@ static int wav_read_header(AVFormatContext *s)
 
             if (rf64) {
                 next_tag_ofs = wav->data_end = avio_tell(pb) + data_size;
-            } else {
+            } else if (size != 0xFFFFFFFF) {
                 data_size    = size;
                 next_tag_ofs = wav->data_end = size ? next_tag_ofs : INT64_MAX;
+            } else {
+                av_log(s, AV_LOG_WARNING, "Ignoring maximum wav data size, "
+                       "file may be invalid\n");
+                data_size    = 0;
+                next_tag_ofs = wav->data_end = INT64_MAX;
             }
 
             data_ofs = avio_tell(pb);