Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn Heusipp <osmanx@problemloesungsmaschine.de>2016-07-17 16:37:12 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-07-17 17:20:46 +0300
commitf1eb6ddcb34f4d27d52d4a0a30269728612c41b0 (patch)
tree8ad9cbd540756ee31db8d575c7e276f2108f303c /libavformat/libopenmpt.c
parent2b14204339bdc8833e022fd2f9f7ca8e572aec59 (diff)
libavformat/libopenmpt: Fix memory leak in error path in read_header_openmpt().
Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/libopenmpt.c')
-rw-r--r--libavformat/libopenmpt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index fd388280dc..58a02be610 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -89,8 +89,11 @@ static int read_header_openmpt(AVFormatContext *s)
add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, "message"));
st = avformat_new_stream(s, NULL);
- if (!st)
+ if (!st) {
+ openmpt_module_destroy(openmpt->module);
+ openmpt->module = NULL;
return AVERROR(ENOMEM);
+ }
avpriv_set_pts_info(st, 64, 1, 1000);
if (st->duration > 0)
st->duration = llrint(openmpt->duration*AV_TIME_BASE);
@@ -146,6 +149,7 @@ static int read_close_openmpt(AVFormatContext *s)
{
OpenMPTContext *openmpt = s->priv_data;
openmpt_module_destroy(openmpt->module);
+ openmpt->module = NULL;
return 0;
}