Commit a8ad83b7 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/aacsbr_template: Do not leave bs_num_env invalid

Fixes out of array read
Fixes: 1349/clusterfuzz-testcase-minimized-5370707196248064

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a234b5ad
...@@ -640,6 +640,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, ...@@ -640,6 +640,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
av_log(ac->avctx, AV_LOG_ERROR, av_log(ac->avctx, AV_LOG_ERROR,
"Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n", "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
ch_data->bs_num_env); ch_data->bs_num_env);
ch_data->bs_num_env = 2;
return -1; return -1;
} }
...@@ -695,6 +696,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, ...@@ -695,6 +696,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
av_log(ac->avctx, AV_LOG_ERROR, av_log(ac->avctx, AV_LOG_ERROR,
"Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n", "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
ch_data->bs_num_env); ch_data->bs_num_env);
ch_data->bs_num_env = 2;
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment