shithub: sox

Download patch

ref: 16abc9a5f82201507ba30c99df4d2811959ae5e8
parent: 7739ec7c2c21de54b7ee1f2155057600892d1814
author: Mans Rullgard <mans@mansr.com>
date: Tue Aug 4 07:56:38 EDT 2020

aiff: fix reading of zero-length files [bug #310]

If we hit EOF, we should check whether an SSND chunk was seen,
even if it contains no samples.

Reported by Ross Bencina.

--- a/src/aiff.c
+++ b/src/aiff.c
@@ -88,7 +88,7 @@
   /* The SSND chunk must be the last in the file */
   while (1) {
     if (lsx_reads(ft, buf, (size_t)4) == SOX_EOF) {
-      if (ssndsize > 0)
+      if (seekto > 0)
         break;
       else {
         lsx_fail_errno(ft,SOX_EHDR,"Missing SSND chunk in AIFF file");