diff mbox series

[FFmpeg-devel,08/12] avformat/mov: Check for duplicate st3d

Message ID 20210131191818.17203-8-michael@niedermayer.cc
State Accepted
Commit 658f0606cba0f866714cbe09af30ec40c4168930
Headers show
Series [FFmpeg-devel,01/12] avcodec/hevc_sei: Check payload size in decode_nal_sei_message() | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 31, 2021, 7:18 p.m. UTC
Fixes: memleak
Fixes: 29585/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6594188688490496

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

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index ad0b9a58d3..b754789bcb 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5559,6 +5559,10 @@  static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         av_log(c->fc, AV_LOG_ERROR, "Empty stereoscopic video box\n");
         return AVERROR_INVALIDDATA;
     }
+
+    if (sc->stereo3d)
+        return AVERROR_INVALIDDATA;
+
     avio_skip(pb, 4); /* version + flags */
 
     mode = avio_r8(pb);