[FFmpeg-cvslog] libavformat/utils: Fix segfault on m4a cover artwork parsing

Lazaros Koromilas git at videolan.org
Wed May 28 03:49:19 CEST 2014


ffmpeg | branch: master | Lazaros Koromilas <lostd at 2f30.org> | Tue May 27 14:38:44 2014 +0300| [bbc10a1aa537c75224b14252eb94c4c829c61a3b] | committer: Michael Niedermayer

libavformat/utils: Fix segfault on m4a cover artwork parsing

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index f35e956..3576279 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -517,6 +517,8 @@ int avformat_queue_attached_pictures(AVFormatContext *s)
         if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
             s->streams[i]->discard < AVDISCARD_ALL) {
             AVPacket copy = s->streams[i]->attached_pic;
+            if (copy.size <= 0)
+                return AVERROR(EINVAL);
             copy.buf = av_buffer_ref(copy.buf);
             if (!copy.buf)
                 return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list