From: "Ronald S. Bultje" <[email protected]>

Fixes crashes if reading the tag value fails.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
---
 libavformat/apetag.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 6c65a1c..378ae10 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);
     }
-- 
1.7.7.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to