[FFmpeg-cvslog] lavfi/subtitles: zero-init AVSubtitle.

Clément Bœsch git at videolan.org
Thu Apr 25 00:58:55 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Apr 25 00:56:36 2013 +0200| [035a3792c223d3b2bba79f38049bd6363b2d470d] | committer: Clément Bœsch

lavfi/subtitles: zero-init AVSubtitle.

This avoids invalid free when the stream id doesn't match the packet
stream index.

Ticket #2501

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

 libavfilter/vf_subtitles.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 10f07a4..b5f5bc9 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -323,7 +323,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx)
     pkt.size = 0;
     while (av_read_frame(fmt, &pkt) >= 0) {
         int i, got_subtitle;
-        AVSubtitle sub;
+        AVSubtitle sub = {0};
 
         if (pkt.stream_index == sid) {
             ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_subtitle, &pkt);



More information about the ffmpeg-cvslog mailing list