]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/wavdec.c
cafdec: fix overflow checking in read_header()
[ffmpeg] / libavformat / wavdec.c
index 451187739ffbe6275598aff8d5434f93e8a998df..782fa6416d19c0cfaa993f5f508133010aa61ae1 100644 (file)
@@ -610,6 +610,12 @@ static int w64_read_header(AVFormatContext *s)
             avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
 
             avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
+        } else if (!memcmp(guid, ff_w64_guid_fact, 16)) {
+            int64_t samples;
+
+            samples = avio_rl64(pb);
+            if (samples > 0)
+                st->duration = samples;
         } else if (!memcmp(guid, ff_w64_guid_data, 16)) {
             wav->data_end = avio_tell(pb) + size - 24;