summaryrefslogtreecommitdiff
path: root/libavformat/asfdec.c
diff options
context:
space:
mode:
authorAlexandra Hájková <alexandra.khirnova@gmail.com>2015-07-23 08:59:53 +0200
committerAnton Khirnov <anton@khirnov.net>2015-07-23 09:48:26 +0200
commitaed7715b8fa295980c221f1cd095d42cd3bd74a6 (patch)
tree9126b087e8d7b93e5fa3b1b2e61e9f350a90fa95 /libavformat/asfdec.c
parentee80f834cbb6dbacdc1efb4c658a7d775e82ebff (diff)
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.c2
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;