Open SuyueGuo opened 3 months ago
Looked into this a little:
The division by zero occurs at: https://github.com/MediaArea/MediaInfoLib/blob/f24a17b415eca1f37cf7b75d120634173ff3131e/Source/MediaInfo/Audio/File_Aac_GeneralAudio_Sbr.cpp#L767
Value of sampling_frequency
is propagated though a few functions from where it is assigned zero at:
https://github.com/MediaArea/MediaInfoLib/blob/f24a17b415eca1f37cf7b75d120634173ff3131e/Source/MediaInfo/Audio/File_Usac.cpp#L5072
This is because Frequency_b
is assigned zero at:
https://github.com/MediaArea/MediaInfoLib/blob/f24a17b415eca1f37cf7b75d120634173ff3131e/Source/MediaInfo/Audio/File_Aac_Main.cpp#L587
This is because sampling_frequency_index
is 13
here:
https://github.com/MediaArea/MediaInfoLib/blob/f24a17b415eca1f37cf7b75d120634173ff3131e/Source/MediaInfo/Audio/File_Aac_Main.cpp#L576
So if I understand correctly, any AAC stream with reserved (13/14) or out-of-range sampling frequency index has the potential to cause this division-by-zero crash.
at line sampling_frequency=Frequency_b/2; it should check whether Frequency_b is zero.
Dear maintainers of MediaInfo,
A division with zero bugs was found in MediaInfoLib.
Poc
div_zero.zip
command to run:
Details
GDB output:
ASAN output: