diff mbox series

[FFmpeg-devel,1/2] avformat/thp: Require a video stream

Message ID 20200415191842.5461-1-michael@niedermayer.cc
State Accepted
Commit 97c78caf3e8f7ec4df3d3123b5e8d0e7541319e6
Headers show
Series [FFmpeg-devel,1/2] avformat/thp: Require a video stream | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Michael Niedermayer April 15, 2020, 7:18 p.m. UTC
The demuxer code assumes the existence of a video stream

Fixes: assertion failure
Fixes: 21512/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5699660783288320

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

Comments

Michael Niedermayer May 9, 2020, 11:09 p.m. UTC | #1
On Wed, Apr 15, 2020 at 09:18:41PM +0200, Michael Niedermayer wrote:
> The demuxer code assumes the existence of a video stream
> 
> Fixes: assertion failure
> Fixes: 21512/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5699660783288320
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/thp.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply patchset

[...]
diff mbox series

Patch

diff --git a/libavformat/thp.c b/libavformat/thp.c
index 332ed79128..d3ae86c645 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -145,6 +145,9 @@  static int thp_read_header(AVFormatContext *s)
         }
     }
 
+    if (!thp->vst)
+        return AVERROR_INVALIDDATA;
+
     return 0;
 }