mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
flac: Explicitly reject FLAC files with more than two channels (FS#13306)
It's not clear that we've ever intended to support >2ch files, based on '#define MAX_CHANNELS 2' and other logic that only seems to care about mono vs not. Change-Id: I15e92fb29cceef32e63fc3a821f6e96bbde930b6
This commit is contained in:
parent
542eeae11c
commit
772eff8ca6
1 changed files with 23 additions and 17 deletions
|
@ -156,6 +156,12 @@ static bool flac_init(FLACContext* fc, int first_frame_offset)
|
|||
fc->channels = ((buf[12]&0x0e)>>1) + 1;
|
||||
fc->bps = (((buf[12]&0x01) << 4) | ((buf[13]&0xf0)>>4) ) + 1;
|
||||
|
||||
if (fc->channels > MAX_CHANNELS) {
|
||||
LOGF("FLAC: Too many channels (%d > %d)\n",
|
||||
fc->channels, MAX_CHANNELS);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* totalsamples is a 36-bit field, but we assume <= 32 bits are
|
||||
used */
|
||||
fc->totalsamples = (buf[14] << 24) | (buf[15] << 16)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue