From 2f4568e525ffbc253bd7777b5cb6bf3706988cae Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Wed, 27 Feb 2008 09:30:56 +0000 Subject: [PATCH] return error if malloc fails Originally committed as revision 12262 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 75746bd..3a18e66 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -255,6 +255,8 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) len += 1; if (type == 2) { // absolute path dref->path = av_mallocz(len+1); + if (!dref->path) + return AVERROR(ENOMEM); get_buffer(pb, dref->path, len); if (len > volume_len && !strncmp(dref->path, volume, volume_len)) { len -= volume_len; -- 2.7.4