avformat/mxfdec: free duplicated utf16 strings

Fixes: memleak
Fixes: 23415/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5124814510751744

Suggested-by: Marton Balint <cus@passwd.hu>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0aa2768cb2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-06-14 19:45:05 +02:00
parent 5fd3af45bc
commit 774efe1ece
1 changed files with 1 additions and 0 deletions

View File

@ -866,6 +866,7 @@ static inline int mxf_read_utf16_string(AVIOContext *pb, int size, char** str, i
return AVERROR(EINVAL);
buf_size = size + size / 2 + 1;
av_free(*str);
*str = av_malloc(buf_size);
if (!*str)
return AVERROR(ENOMEM);