[FFmpeg-devel,1/9] avcodec/mpegaudio_parser: Initialize poutbuf*

Submitted by Michael Niedermayer on Aug. 5, 2018, 8:29 p.m.

Details

Message ID 20180805202937.7563-1-michael@niedermayer.cc
State Accepted
Commit 0f4c3b0b8e5435d13fd3b64c91969b31c3c018dc
Headers show

Commit Message

Michael Niedermayer Aug. 5, 2018, 8:29 p.m.
Possibly fixes: null pointer dereference
Possibly fixes: 9352/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5146068961460224
Fixes: Heap-use-after-free
Fixes: 9453/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5137954375729152

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

Comments

Michael Niedermayer Aug. 12, 2018, 7:51 p.m.
On Sun, Aug 05, 2018 at 10:29:29PM +0200, Michael Niedermayer wrote:
> Possibly fixes: null pointer dereference
> Possibly fixes: 9352/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5146068961460224
> Fixes: Heap-use-after-free
> Fixes: 9453/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5137954375729152
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/mpegaudio_parser.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c
index 244281b56f..a109f12701 100644
--- a/libavcodec/mpegaudio_parser.c
+++ b/libavcodec/mpegaudio_parser.c
@@ -99,6 +99,8 @@  static int mpegaudio_parse(AVCodecParserContext *s1,
                     } else if (codec_id == AV_CODEC_ID_MP3ADU) {
                         avpriv_report_missing_feature(avctx,
                             "MP3ADU full parser");
+                        *poutbuf = NULL;
+                        *poutbuf_size = 0;
                         return 0; /* parsers must not return error codes */
                     }