[FFmpeg-cvslog] apetag: propagate errors.

Ronald S. Bultje git at videolan.org
Sat Feb 25 04:28:16 CET 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Thu Feb 23 15:35:24 2012 -0800| [6d11057006b30ee6737a77f712cdd6a8f7e6c3df] | committer: Ronald S. Bultje

apetag: propagate errors.

Fixes crashes if reading the tag value fails.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6d11057006b30ee6737a77f712cdd6a8f7e6c3df
---

 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);
     }



More information about the ffmpeg-cvslog mailing list