Browse Source

avformat/libmodplug: fix memleak when load modplug failed

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
tags/n4.3
Steven Liu 5 years ago
parent
commit
22eae2d0c9
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavformat/libmodplug.c

+ 3
- 2
libavformat/libmodplug.c View File

@@ -216,9 +216,10 @@ static int modplug_read_header(AVFormatContext *s)
ModPlug_SetSettings(&settings);

modplug->f = ModPlug_Load(modplug->buf, sz);
if (!modplug->f)
if (!modplug->f) {
av_freep(&modplug->buf);
return AVERROR_INVALIDDATA;
}
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);


Loading…
Cancel
Save