diff options
author | Alexandra Hájková <alexandra.khirnova@gmail.com> | 2015-07-23 08:59:53 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-07-23 09:48:26 +0200 |
commit | aed7715b8fa295980c221f1cd095d42cd3bd74a6 (patch) | |
tree | 9126b087e8d7b93e5fa3b1b2e61e9f350a90fa95 /libavformat/asfdec.c | |
parent | ee80f834cbb6dbacdc1efb4c658a7d775e82ebff (diff) | |
download | ffmpeg-aed7715b8fa295980c221f1cd095d42cd3bd74a6.tar.gz |
asfdec: increment nb_streams right after the stream allocation
to prevent possible memory leaks
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r-- | libavformat/asfdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 305c01c62b..d9e9a5a359 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -745,6 +745,7 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable * if (!asf->asf_st[asf->nb_streams]) return AVERROR(ENOMEM); asf_st = asf->asf_st[asf->nb_streams]; + asf->nb_streams++; asf_st->stream_index = stream_index; asf_st->index = st->index; asf_st->indexed = 0; @@ -785,7 +786,6 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable * avio_skip(pb, err_data_len); } - asf->nb_streams++; align_position(pb, asf->offset, size); return 0; |