Skip to content

Commit

Permalink
fix add validity checks when dealing with AOT_SBR as in ffmpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshevach committed Sep 8, 2024
1 parent f33de58 commit ad764fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nginx-pckg-module/src/media/codec_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ codec_config_mp4a_config_parse(
vod_str_t* extra_data,
mp4a_config_t* result)
{
bit_reader_state_t reader;
bit_reader_state_t reader, temp_reader;
uint8_t ext_sample_rate_index;

vod_log_buffer(VOD_LOG_DEBUG_LEVEL, log, 0, "codec_config_mp4a_config_parse: extra data ", extra_data->data, extra_data->len);
Expand All @@ -500,7 +500,9 @@ codec_config_mp4a_config_parse(
goto error;
}

if (result->object_type == AOT_SBR || result->object_type == AOT_PS)
temp_reader = reader;
if (result->object_type == AOT_SBR || (result->object_type == AOT_PS &&
!(bit_read_stream_get(&temp_reader, 3) & 0x03 && !(bit_read_stream_get(&temp_reader, 9) & 0x3f))))
{
ext_sample_rate_index = bit_read_stream_get(&reader, 4);
if (ext_sample_rate_index == 0x0f)
Expand Down

0 comments on commit ad764fb

Please sign in to comment.