You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
asfdec: increment nb_streams right after the stream allocation
to prevent possible memory leaks Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
committed by
Anton Khirnov
parent
ee80f834cb
commit
aed7715b8f
@@ -745,6 +745,7 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable *
|
|||||||
if (!asf->asf_st[asf->nb_streams])
|
if (!asf->asf_st[asf->nb_streams])
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
asf_st = asf->asf_st[asf->nb_streams];
|
asf_st = asf->asf_st[asf->nb_streams];
|
||||||
|
asf->nb_streams++;
|
||||||
asf_st->stream_index = stream_index;
|
asf_st->stream_index = stream_index;
|
||||||
asf_st->index = st->index;
|
asf_st->index = st->index;
|
||||||
asf_st->indexed = 0;
|
asf_st->indexed = 0;
|
||||||
@@ -785,7 +786,6 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable *
|
|||||||
avio_skip(pb, err_data_len);
|
avio_skip(pb, err_data_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
asf->nb_streams++;
|
|
||||||
align_position(pb, asf->offset, size);
|
align_position(pb, asf->offset, size);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user