1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avformat/id3v2: Free buffer in decode_str()

Fixes: memleak
Fixes: 60058/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5665259244093440

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-06-30 01:57:03 +02:00
parent f9b29451e4
commit c41ab871c7
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -309,8 +309,10 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
avio_w8(dynbuf, 0);
dynsize = avio_close_dyn_buf(dynbuf, dst);
if (dynsize <= 0)
if (dynsize <= 0) {
av_freep(dst);
return AVERROR(ENOMEM);
}
*maxread = left;
return 0;