aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/apetag.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-23 15:35:24 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-02-23 15:53:26 -0800
commit6d11057006b30ee6737a77f712cdd6a8f7e6c3df (patch)
treed4d66e411a297e348303455818af0a95923c17c7 /libavformat/apetag.c
parent2784d187919b48022a89633fb3b5a99ca97cf869 (diff)
downloadffmpeg-6d11057006b30ee6737a77f712cdd6a8f7e6c3df.tar.gz
apetag: propagate errors.
Fixes crashes if reading the tag value fails. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavformat/apetag.c')
-rw-r--r--libavformat/apetag.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 6c65a1c449..378ae10ad4 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -75,6 +75,8 @@ static int ape_tag_read_field(AVFormatContext *s)
if (!value)
return AVERROR(ENOMEM);
c = avio_read(pb, value, size);
+ if (c < 0)
+ return c;
value[c] = 0;
av_dict_set(&s->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
}