Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57434d3e authored by Dongwon Kang's avatar Dongwon Kang Committed by JP Sugarbroad
Browse files

Handle bad bitrate index in mp3dec.

Reference:
  https://www.mp3-tech.org/programmer/frame_header.html

Test: run poc with and without this patch.
Bug: 71868329
Change-Id: Ibf6196eba0b99459e84989ac8c13db57c816c572
(cherry picked from commit 8b638123)
parent 418ee677
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ ERROR_CODE pvmp3_decode_header(tmp3Bits *inputStream,
    info->emphasis           = (temp << 30) >> 30;  /* 2 */


    if (!info->bitrate_index || info->sampling_frequency == 3)
    if (!info->bitrate_index || info->bitrate_index == 15 || info->sampling_frequency == 3)
    {
        err = UNSUPPORTED_FREE_BITRATE;
    }