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 0aa2768cb275bda9e9e1331ed95adc7cd686eafe) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c12f7ef056
commit
d6c265e22a
@ -765,6 +765,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user