Merge commit 'd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 27 Sep 2013 10:13:41 +0000 (12:13 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 27 Sep 2013 10:13:41 +0000 (12:13 +0200)
* 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>
12 files changed:
1  2 
libavformat/avidec.c
libavformat/avienc.c
libavformat/aviobuf.c
libavformat/mmst.c
libavformat/oggparsetheora.c
libavformat/oggparsevorbis.c
libavformat/rdt.c
libavformat/rtmphttp.c
libavformat/rtmpproto.c
libavformat/rtpdec_qt.c
libavformat/smacker.c
libavformat/smoothstreamingenc.c

Simple merge
@@@ -566,12 -538,14 +566,15 @@@ static int avi_write_packet(AVFormatCon
          int cl = idx->entry / AVI_INDEX_CLUSTER_SIZE;
          int id = idx->entry % AVI_INDEX_CLUSTER_SIZE;
          if (idx->ents_allocated <= idx->entry) {
 -            if ((err = av_reallocp(&idx->cluster, (cl + 1) * sizeof(*idx->cluster))) < 0) {
 +            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 err;
 +                return AVERROR(ENOMEM);
+             }
              idx->cluster[cl] = av_malloc(AVI_INDEX_CLUSTER_SIZE*sizeof(AVIIentry));
              if (!idx->cluster[cl])
 -                return -1;
 +                return AVERROR(ENOMEM);
              idx->ents_allocated += AVI_INDEX_CLUSTER_SIZE;
          }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge