24 lines
774 B
Diff
24 lines
774 B
Diff
commit f833c53cb596e9e1792949f762e0b33661822748
|
|
Author: Erik de Castro Lopo <erikd@mega-nerd.com>
|
|
Date: Tue May 23 20:15:24 2017 +1000
|
|
|
|
src/aiff.c: Fix a buffer read overflow
|
|
|
|
Secunia Advisory SA76717.
|
|
|
|
Found by: Laurent Delosieres, Secunia Research at Flexera Software
|
|
|
|
diff --git src/aiff.c src/aiff.c
|
|
index 5b5f9f53..45864b76 100644
|
|
--- src/aiff.c
|
|
+++ src/aiff.c
|
|
@@ -1759,7 +1759,7 @@ aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword)
|
|
psf_binheader_readf (psf, "j", dword - bytesread) ;
|
|
|
|
if (map_info->channel_map != NULL)
|
|
- { size_t chanmap_size = psf->sf.channels * sizeof (psf->channel_map [0]) ;
|
|
+ { size_t chanmap_size = SF_MIN (psf->sf.channels, layout_tag & 0xffff) * sizeof (psf->channel_map [0]) ;
|
|
|
|
free (psf->channel_map) ;
|
|
|