mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avformat/samidec: Deallocate hdr_buf
Fixes: memleak Fixes: 30841/clusterfuzz-testcase-minimized-ffmpeg_dem_SAMI_fuzzer-4521799196999680 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:
parent
cd3ab3a09b
commit
1c88098651
@ -89,6 +89,7 @@ static int sami_read_header(AVFormatContext *s)
|
|||||||
sub = ff_subtitles_queue_insert(&sami->q, buf.str, buf.len, !is_sync);
|
sub = ff_subtitles_queue_insert(&sami->q, buf.str, buf.len, !is_sync);
|
||||||
if (!sub) {
|
if (!sub) {
|
||||||
res = AVERROR(ENOMEM);
|
res = AVERROR(ENOMEM);
|
||||||
|
av_bprint_finalize(&hdr_buf, NULL);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (is_sync) {
|
if (is_sync) {
|
||||||
@ -97,6 +98,7 @@ static int sami_read_header(AVFormatContext *s)
|
|||||||
sub->pts = p ? strtol(p, NULL, 10) : 0;
|
sub->pts = p ? strtol(p, NULL, 10) : 0;
|
||||||
if (sub->pts <= INT64_MIN/2 || sub->pts >= INT64_MAX/2) {
|
if (sub->pts <= INT64_MIN/2 || sub->pts >= INT64_MAX/2) {
|
||||||
res = AVERROR_PATCHWELCOME;
|
res = AVERROR_PATCHWELCOME;
|
||||||
|
av_bprint_finalize(&hdr_buf, NULL);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user