* commit 'd872fb0f7f':
  lavf: Reset the entry count and allocation size variables on av_reallocp failures

Conflicts:
	libavformat/avienc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-27 12:13:41 +02:00
commit 72eddc10fa
12 changed files with 44 additions and 15 deletions

View file

@ -567,8 +567,11 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
int id = idx->entry % AVI_INDEX_CLUSTER_SIZE;
if (idx->ents_allocated <= idx->entry) {
idx->cluster = av_realloc_f(idx->cluster, sizeof(void*), cl+1);
if (!idx->cluster)
if (!idx->cluster) {
idx->ents_allocated = 0;
idx->entry = 0;
return AVERROR(ENOMEM);
}
idx->cluster[cl] = av_malloc(AVI_INDEX_CLUSTER_SIZE*sizeof(AVIIentry));
if (!idx->cluster[cl])
return AVERROR(ENOMEM);