[FFmpeg-devel] avcodec/aacdec_template: skip apply_tns() if max_sfb is 0 (from previous header decode failure)

Submitted by Michael Niedermayer on May 18, 2019, 10:01 a.m.

Details

Message ID 20190518100135.14909-1-michael@niedermayer.cc
State Accepted
Commit cf3156e762bbd3fbaf9da53f3ef1ea6d1bad2ec5
Headers show

Commit Message

Michael Niedermayer May 18, 2019, 10:01 a.m.
Fixes: NULL pointer dereference
Fixes: 14723/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5654612436058112
Fixes: 14724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5712607111020544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/aacdec_template.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer June 4, 2019, 8:54 a.m.
On Sat, May 18, 2019 at 12:01:35PM +0200, Michael Niedermayer wrote:
> Fixes: NULL pointer dereference
> Fixes: 14723/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5654612436058112
> Fixes: 14724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5712607111020544
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/aacdec_template.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 721511c5e9..39d859e458 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -2493,6 +2493,9 @@  static void apply_tns(INTFLOAT coef_param[1024], TemporalNoiseShaping *tns,
     INTFLOAT tmp[TNS_MAX_ORDER+1];
     UINTFLOAT *coef = coef_param;
 
+    if(!mmm)
+        return;
+
     for (w = 0; w < ics->num_windows; w++) {
         bottom = ics->num_swb;
         for (filt = 0; filt < tns->n_filt[w]; filt++) {