comparison movenc.c @ 3858:62a7a6a6a038 libavformat

check for malloc failure
author bcoudurier
date Sun, 31 Aug 2008 20:21:00 +0000
parents 50bb82abb278
children 9288b207a184
comparison
equal deleted inserted replaced
3857:50bb82abb278 3858:62a7a6a6a038
1614 size = pkt->size; 1614 size = pkt->size;
1615 } else if (enc->codec_id == CODEC_ID_DNXHD && !trk->vosLen) { 1615 } else if (enc->codec_id == CODEC_ID_DNXHD && !trk->vosLen) {
1616 /* copy frame to create needed atoms */ 1616 /* copy frame to create needed atoms */
1617 trk->vosLen = size; 1617 trk->vosLen = size;
1618 trk->vosData = av_malloc(size); 1618 trk->vosData = av_malloc(size);
1619 if (!trk->vosData)
1620 return AVERROR(ENOMEM);
1619 memcpy(trk->vosData, pkt->data, size); 1621 memcpy(trk->vosData, pkt->data, size);
1620 } 1622 }
1621 1623
1622 if (!(trk->entry % MOV_INDEX_CLUSTER_SIZE)) { 1624 if (!(trk->entry % MOV_INDEX_CLUSTER_SIZE)) {
1623 trk->cluster = av_realloc(trk->cluster, (trk->entry + MOV_INDEX_CLUSTER_SIZE) * sizeof(*trk->cluster)); 1625 trk->cluster = av_realloc(trk->cluster, (trk->entry + MOV_INDEX_CLUSTER_SIZE) * sizeof(*trk->cluster));