Commit 68f623d6 authored by Steven Liu's avatar Steven Liu

avformat/wc3movie: fix memleak when read content size not equvipe input size

Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent 70c6e840
......@@ -130,8 +130,10 @@ static int wc3_read_header(AVFormatContext *s)
buffer = av_malloc(size+1);
if (!buffer)
return AVERROR(ENOMEM);
if ((ret = avio_read(pb, buffer, size)) != size)
if ((ret = avio_read(pb, buffer, size)) != size) {
av_freep(&buffer);
return AVERROR(EIO);
}
buffer[size] = 0;
av_dict_set(&s->metadata, "title", buffer,
AV_DICT_DONT_STRDUP_VAL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment