lavfi/subtitles: zero-init AVSubtitle.
This avoids invalid free when the stream id doesn't match the packet stream index. Ticket #2501 (cherry picked from commit 035a3792c223d3b2bba79f38049bd6363b2d470d)
This commit is contained in:
parent
0a53c7016f
commit
3d6219b6db
@ -332,7 +332,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
|
|||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user