1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

libavformat/utils: Fix segfault on m4a cover artwork parsing

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Lazaros Koromilas 2014-05-27 14:38:44 +03:00 committed by Michael Niedermayer
parent 12875df324
commit bbc10a1aa5

View File

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