Commit 14c98973 authored by Paul B Mahol's avatar Paul B Mahol Committed by Ronald S. Bultje

apetag: do not leak memory if avio_read() fails

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent 6d110570
......@@ -75,8 +75,10 @@ static int ape_tag_read_field(AVFormatContext *s)
if (!value)
return AVERROR(ENOMEM);
c = avio_read(pb, value, size);
if (c < 0)
if (c < 0) {
av_free(value);
return c;
}
value[c] = 0;
av_dict_set(&s->metadata, key, value, 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