diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-05 23:00:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-16 16:00:22 +0200 |
commit | fb4a81dc3aa35ea53e19c2acb0f57d1bbd0cc2f8 (patch) | |
tree | 911f367ee6f1b0fe3096aed0659afc70938a25fc /libavcodec | |
parent | 09244917995527f0b83dc63814ace8e9ae50668d (diff) | |
download | ffmpeg-fb4a81dc3aa35ea53e19c2acb0f57d1bbd0cc2f8.tar.gz |
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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a8ad83b793e883b8c6d114f81073a4e40c0308a3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aacsbr_template.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c index 511054276a..4d4b705dfa 100644 --- a/libavcodec/aacsbr_template.c +++ b/libavcodec/aacsbr_template.c @@ -639,6 +639,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, av_log(ac->avctx, AV_LOG_ERROR, "Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n", ch_data->bs_num_env); + ch_data->bs_num_env = 2; return -1; } @@ -694,6 +695,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, av_log(ac->avctx, AV_LOG_ERROR, "Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n", ch_data->bs_num_env); + ch_data->bs_num_env = 2; return -1; } |