shithub: sox

Download patch

ref: fc127d048ad38130f355de822dccd899fc4086dc
parent: b94453cf76451ef4a80744b6158b6d944751e541
author: Ulrich Klauer <ulrich@chirlu.de>
date: Tue Oct 16 06:34:18 EDT 2012

Fix reading 64-bit float WAVs

Trying to read WAV files with 64-bit samples used to fail. Tell the WAV
handler that 8 bytes (64 bits) is an acceptable size for a sample.

Reported and analyzed by nu774 in issue 3481510.

--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
   o Fix crash when seeking within a FLAC file. [3476843] (Eric Wong)
   o Fix Ogg Vorbis files with certain numbers of channels being
     truncated. (Ulrich Klauer)
+  o Fix reading 64-bit float WAVs. [3481510] (nu774 and Ulrich Klauer)
 
 Audio device drivers:
 
--- a/src/wav.c
+++ b/src/wav.c
@@ -782,6 +782,11 @@
         ft->encoding.encoding = SOX_ENCODING_SIGN2;
       break;
 
+    case 8:
+      if (ft->encoding.encoding == SOX_ENCODING_UNKNOWN)
+        ft->encoding.encoding = SOX_ENCODING_FLOAT;
+      break;
+
     default:
       lsx_fail_errno(ft,SOX_EFMT,"Sorry, don't understand .wav size");
       return SOX_EOF;