aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avienc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-27 12:13:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-27 12:13:41 +0200
commit72eddc10fa1f3ca7fb95292673fa26401f754c92 (patch)
tree878039cdab1f882bc68a9e60203e430d42eb8d54 /libavformat/avienc.c
parent328a5b93d3a493d6a653a83c425fb2cc98e8f41b (diff)
parentd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9 (diff)
downloadffmpeg-72eddc10fa1f3ca7fb95292673fa26401f754c92.tar.gz
Merge commit 'd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9'
* commit 'd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9': lavf: Reset the entry count and allocation size variables on av_reallocp failures Conflicts: libavformat/avienc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avienc.c')
-rw-r--r--libavformat/avienc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index a8d333e348..3401cbc237 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -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);