aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLazaros Koromilas <lostd@2f30.org>2014-05-27 14:38:44 +0300
committerMichael Niedermayer <michaelni@gmx.at>2014-05-28 03:35:39 +0200
commitbbc10a1aa537c75224b14252eb94c4c829c61a3b (patch)
tree298342f7b40d74085da31760187592a116510c1e
parent12875df324e5d3c563176cb108b1c09182fe1dfa (diff)
downloadffmpeg-bbc10a1aa537c75224b14252eb94c4c829c61a3b.tar.gz
libavformat/utils: Fix segfault on m4a cover artwork parsing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index f35e956f74..357627924a 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);