mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
apetag: do not leak memory if avio_read() fails
Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
parent
6d11057006
commit
14c98973f5
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user