ittiam-systems / libmpegh

MPEG-H 3D Audio Low Complexity Profile Decoder. Encoder: https://github.com/ittiam-systems/libmpeghe
http://www.ittiam.com/
BSD 3-Clause Clear License
88 stars 18 forks source link

global-buffer-overflow reported by asan when decoding a sample #45

Closed amiartus closed 1 year ago

amiartus commented 1 year ago

Hello,

Please have a look at following report by asan when playing a sample:

  1. amend CMakeLists.txt
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index a0226d5..7fe656c 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -7,6 +7,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
    set(CMAKE_CXX_EXTENSIONS OFF)
    set(CMAKE_SUPPRESS_REGENERATION true)

+add_compile_options(-fsanitize=address) +add_link_options(-fsanitize=address) +

Add Library Target

add_library ( ia_mpeghd_lib


2. build and run with file [crash-1.txt](https://github.com/ittiam-systems/libmpegh/files/10706650/crash-1.txt)

`
./ia_mpeghd_testbench -ifile:/crash-1.txt -ofile:1.wav
`

Stack trace:

0 0x55a63e45ad73 in impeghd_hoa_ren_space_positions_init_with_param

1 0x55a63e51539d in impeghd_hoa_ren_renderer_init

2 0x55a63e440231 in impeghd_hoa_dec_init

3 0x55a63e3ddbc3 in ia_core_coder_dec_process_frame_zero

4 0x55a63e3e1f2c in ia_core_coder_dec_main

5 0x55a63e3a76bd in ia_core_coder_dec_init

6 0x55a63e3a1f79 in ia_mpegh_dec_init

7 0x55a63e36f978 in impeghd_main_process

SakethSathuvalli commented 1 year ago

The fix is now available on latest main - ec35a10. Can you please try it once @miartad ?

Thanks!

amiartus commented 1 year ago

working on my end as well, thanks!