diff mbox

[FFmpeg-devel,2/2] avcodec/vp8_parser: Do not leave data/size uninitialized

Message ID 20180706103442.15743-2-michael@niedermayer.cc
State Accepted
Commit 284dde24dab30225ed3e233b0e5908d67d7e13e7
Headers show

Commit Message

Michael Niedermayer July 6, 2018, 10:34 a.m. UTC
This is identical to what the VP9 parser does

Fixes: 9215/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVPX_VP8_fuzzer-5768227253649408
Fixes: out of memory access

This may also fix oss fuzz issue 9212

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

Comments

Michael Niedermayer July 7, 2018, 10:08 a.m. UTC | #1
On Fri, Jul 06, 2018 at 12:34:42PM +0200, Michael Niedermayer wrote:
> This is identical to what the VP9 parser does
> 
> Fixes: 9215/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVPX_VP8_fuzzer-5768227253649408
> Fixes: out of memory access
> 
> This may also fix oss fuzz issue 9212
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vp8_parser.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox

Patch

diff --git a/libavcodec/vp8_parser.c b/libavcodec/vp8_parser.c
index 609f5077d1..e2d91b271f 100644
--- a/libavcodec/vp8_parser.c
+++ b/libavcodec/vp8_parser.c
@@ -28,6 +28,9 @@  static int parse(AVCodecParserContext *s,
     unsigned int frame_type;
     unsigned int profile;
 
+    *poutbuf      = buf;
+    *poutbuf_size = buf_size;
+
     if (buf_size < 3)
         return buf_size;