[FFmpeg-cvslog] ffmpeg: free empty subtitles as well in transcode_subtitles

Marton Balint git at videolan.org
Sat Nov 30 05:14:02 CET 2013


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat Nov 23 17:27:22 2013 +0100| [4d6f2ff524afc01f2af30677ca271a6387cf8657] | committer: Marton Balint

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 at passwd.hu>
Reviewed-by: Nicolas George <george at nsup.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d6f2ff524afc01f2af30677ca271a6387cf8657
---

 ffmpeg.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index bbd3019..105efbc 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1828,7 +1828,7 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
     sub2video_update(ist, &subtitle);
 
     if (!subtitle.num_rects)
-        return ret;
+        goto out;
 
     for (i = 0; i < nb_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);
     }
 
+out:
     avsubtitle_free(&subtitle);
     return ret;
 }



More information about the ffmpeg-cvslog mailing list