patch-src_aiff_c 782 B

1234567891011121314
  1. --- sox-f3094754a7c2a7e55c35621d20fa9945736e72df.orig/src/aiff.c 2026-05-15 13:54:15.000000000 +0200
  2. +++ sox-f3094754a7c2a7e55c35621d20fa9945736e72df/src/aiff.c 2026-05-15 13:57:27.438679050 +0200
  3. @@ -619,6 +619,11 @@ int lsx_aiffstartwrite(sox_format_t * ft
  4. At 48 kHz, 16 bits stereo, this gives ~3 hours of audio.
  5. Sorry, the AIFF format does not provide for an indefinite
  6. number of samples. */
  7. + if (ft->signal.channels >= (0x7f000000 / (ft->encoding.bits_per_sample >> 3)))
  8. + {
  9. + lsx_fail_errno(ft, SOX_EOF, "too many channels for AIFF header");
  10. + return SOX_EOF;
  11. + }
  12. return(aiffwriteheader(ft, (uint64_t) 0x7f000000 / ((ft->encoding.bits_per_sample>>3)*ft->signal.channels)));
  13. }