check for malloc failure

Originally committed as revision 15132 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2008-08-31 20:21:00 +00:00
parent db568c079a
commit e8c4df40e3

View File

@ -1616,6 +1616,8 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
/* copy frame to create needed atoms */ /* copy frame to create needed atoms */
trk->vosLen = size; trk->vosLen = size;
trk->vosData = av_malloc(size); trk->vosData = av_malloc(size);
if (!trk->vosData)
return AVERROR(ENOMEM);
memcpy(trk->vosData, pkt->data, size); memcpy(trk->vosData, pkt->data, size);
} }