apetag: propagate errors.
Fixes crashes if reading the tag value fails. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
2784d18791
commit
6d11057006
@ -75,6 +75,8 @@ static int ape_tag_read_field(AVFormatContext *s)
|
|||||||
if (!value)
|
if (!value)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
c = avio_read(pb, value, size);
|
c = avio_read(pb, value, size);
|
||||||
|
if (c < 0)
|
||||||
|
return c;
|
||||||
value[c] = 0;
|
value[c] = 0;
|
||||||
av_dict_set(&s->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
|
av_dict_set(&s->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user