shithub: sox

Download patch

ref: c2fda8f3e4f3623d1766d37078fb05d3ef6dbbe8
parent: 5e23e9c24393638380e8474fae1f42661c498967
author: Mans Rullgard <mans@mansr.com>
date: Mon Aug 24 15:25:39 EDT 2020

wav: warn when writing truncated size fields in large files

--- a/src/wav.c
+++ b/src/wav.c
@@ -1468,6 +1468,10 @@
         lsx_debug("        %d byte/sec, %d block align, %d bits/samp",
                 dwAvgBytesPerSec, wBlockAlign, wBitsPerSample);
     } else {
+        if (wRiffLength == UINT32_MAX || dwDataLength == UINT32_MAX ||
+            dwSamplesWritten == UINT32_MAX)
+            lsx_warn("File too large, writing truncated values in header");
+
         lsx_debug("Finished writing Wave file, %"PRIu64" data bytes %"PRIu64" samples",
                   dwDataLength, wav->numSamples);
 #ifdef HAVE_GSM