Check MAX_CHANNELS in sndfile-deinterleave

Allocated buffer has space for only 16 channels. Verify that input file
meets this limit.

Fixes #397

Gbp-Pq: Name Check-MAX_CHANNELS-in-sndfile-deinterleave.patch
This commit is contained in:
Brett T. Warden 2018-08-28 12:01:17 -07:00 committed by openKylinBot
parent 2f9f04989a
commit 8394f75ae0
1 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,13 @@ main (int argc, char **argv)
exit (1) ;
} ;
if (sfinfo.channels > MAX_CHANNELS)
{ printf ("\nError : Input file '%s' has too many (%d) channels. Limit is %d.\n",
argv [1], sfinfo.channels, MAX_CHANNELS) ;
exit (1) ;
} ;
state.channels = sfinfo.channels ;
sfinfo.channels = 1 ;