to prevent possible memory leaks
---
libavformat/asfdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 18e4d7f..18653ad 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -745,7 +745,8 @@ static int asf_read_stream_properties(AVFormatContext *s,
const GUIDParseTable *
asf->asf_st[asf->nb_streams] = av_mallocz(sizeof(*asf_st));
if (!asf->asf_st[asf->nb_streams])
return AVERROR(ENOMEM);
- asf_st = asf->asf_st[asf->nb_streams];
+ asf->nb_streams++;
+ asf_st = asf->asf_st[asf->nb_streams - 1];
asf_st->stream_index = stream_index;
asf_st->index = st->index;
asf_st->indexed = 0;
@@ -786,7 +787,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;
--
2.0.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel