Commit 035a3792 authored by Clément Bœsch's avatar 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
parent d382170c
...@@ -323,7 +323,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx) ...@@ -323,7 +323,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx)
pkt.size = 0; pkt.size = 0;
while (av_read_frame(fmt, &pkt) >= 0) { while (av_read_frame(fmt, &pkt) >= 0) {
int i, got_subtitle; int i, got_subtitle;
AVSubtitle sub; AVSubtitle sub = {0};
if (pkt.stream_index == sid) { if (pkt.stream_index == sid) {
ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_subtitle, &pkt); ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_subtitle, &pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment