jiixyj / libebur128

A library implementing the EBU R128 loudness standard.
MIT License
402 stars 76 forks source link

invalid memory write #69

Closed asarubbo closed 6 years ago

asarubbo commented 7 years ago

On 1.2.2

# minimal-example $FILE
ASAN:DEADLYSIGNAL                                                                                                                                                                                                 
=================================================================                                                                                                                                                 
==11037==ERROR: AddressSanitizer: SEGV on unknown address 0x000000002588 (pc 0x7f37372f4bc3 bp 0x627000000100 sp 0x7ffdf22b2e80 T0)                                                                               
==11037==The signal is caused by a WRITE memory access.                                                                                                                                                           
    #0 0x7f37372f4bc2 in uc2d_array /var/tmp/portage/media-libs/libsndfile-1.0.28-r1/work/libsndfile-1.0.28/src/pcm.c:494                                                                                         
    #1 0x7f37372f4bc2 in pcm_read_uc2d /var/tmp/portage/media-libs/libsndfile-1.0.28-r1/work/libsndfile-1.0.28/src/pcm.c:1267                                                                                     
    #2 0x7f37372bad35 in sf_readf_double /var/tmp/portage/media-libs/libsndfile-1.0.28-r1/work/libsndfile-1.0.28/src/sndfile.c:2055                                                                               
    #3 0x50e2a0 in main /var/tmp/portage/media-libs/libebur128-1.2.2/work/libebur128-1.2.2/test/minimal-example.c:44:30                                                                                           
    #4 0x7f37363f6680 in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.23-r4/work/glibc-2.23/csu/../csu/libc-start.c:289                                                                                    
    #5 0x419d58 in _start (/usr/bin/minimal-example+0x419d58)                                                                                                                                                     

AddressSanitizer can not provide additional info.                                                                                                                                                                 
SUMMARY: AddressSanitizer: SEGV /var/tmp/portage/media-libs/libsndfile-1.0.28-r1/work/libsndfile-1.0.28/src/pcm.c:494 in uc2d_array                                                                               
==11037==ABORTING 

Testcase attached 396.crashes.zip

jiixyj commented 6 years ago

Should be fixed now that the minimal-example.c program is more robust.