mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
ffmpeg: free empty subtitles as well in transcode_subtitles
Even if it does not matter at the moment, because subtitles with num_rect == 0 have no memory allocated, this is how we expect the users to use the API, a returned AVSubtitle should be freed with avsubtitle_free. Signed-off-by: Marton Balint <cus@passwd.hu> Reviewed-by: Nicolas George <george@nsup.org>
This commit is contained in:
parent
3e396ca8ed
commit
4d6f2ff524
3
ffmpeg.c
3
ffmpeg.c
@ -1828,7 +1828,7 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
sub2video_update(ist, &subtitle);
|
sub2video_update(ist, &subtitle);
|
||||||
|
|
||||||
if (!subtitle.num_rects)
|
if (!subtitle.num_rects)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
for (i = 0; i < nb_output_streams; i++) {
|
for (i = 0; i < nb_output_streams; i++) {
|
||||||
OutputStream *ost = output_streams[i];
|
OutputStream *ost = output_streams[i];
|
||||||
@ -1839,6 +1839,7 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
do_subtitle_out(output_files[ost->file_index]->ctx, ost, ist, &subtitle);
|
do_subtitle_out(output_files[ost->file_index]->ctx, ost, ist, &subtitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
avsubtitle_free(&subtitle);
|
avsubtitle_free(&subtitle);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user