aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-05 23:00:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 03:41:33 +0200
commitddab43d3a89a38b1ac6fa6b8623532212f962523 (patch)
tree5aad4d0e6c73a2dc46bc3ce4115f5d7180dbbe5c
parent51b8a78851da3895b993139e708fc0f1a665e605 (diff)
downloadffmpeg-ddab43d3a89a38b1ac6fa6b8623532212f962523.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>
-rw-r--r--libavcodec/aacsbr_template.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
index b36c266ad1..a027e3a67a 100644
--- a/libavcodec/aacsbr_template.c
+++ b/libavcodec/aacsbr_template.c
@@ -637,6 +637,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;
}
@@ -692,6 +693,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;
}