diff mbox series

[FFmpeg-devel] avformat/mxfdec: Free all types for both Descriptors

Message ID 20210107232936.23983-1-michael@niedermayer.cc
State Accepted
Commit 88519be8db66811e203408b413d9039ac9c3fe91
Headers show
Series [FFmpeg-devel] avformat/mxfdec: Free all types for both Descriptors
Related show

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. 7, 2021, 11:29 p.m. UTC
Fixes: memleak
Fixes: 26352/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5201158714687488

Suggested-by: Tomas Härdin <tjoppen@acc.umu.se>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mxfdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Michael Niedermayer Jan. 11, 2021, 10:23 p.m. UTC | #1
On Fri, Jan 08, 2021 at 12:29:36AM +0100, Michael Niedermayer wrote:
> Fixes: memleak
> Fixes: 26352/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5201158714687488
> 
> Suggested-by: Tomas Härdin <tjoppen@acc.umu.se>
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/mxfdec.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index b563f2abe1..9570d9c3c7 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -344,11 +344,10 @@  static void mxf_free_metadataset(MXFMetadataSet **ctx, int freectx)
     MXFIndexTableSegment *seg;
     switch ((*ctx)->type) {
     case Descriptor:
+    case MultipleDescriptor:
         av_freep(&((MXFDescriptor *)*ctx)->extradata);
         av_freep(&((MXFDescriptor *)*ctx)->mastering);
         av_freep(&((MXFDescriptor *)*ctx)->coll);
-        break;
-    case MultipleDescriptor:
         av_freep(&((MXFDescriptor *)*ctx)->sub_descriptors_refs);
         break;
     case Sequence: