Merge commit '2620df13104ddaa136158eb6bb1195adbf9d7692'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Jan 2014 13:11:57 +0000 (14:11 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Jan 2014 13:13:17 +0000 (14:13 +0100)
* commit '2620df13104ddaa136158eb6bb1195adbf9d7692':
  mov: Free an earlier allocated array if allocating a new one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/mov.c

@@@ -1910,9 -1712,12 +1910,10 @@@ static int mov_read_stts(MOVContext *c
      av_dlog(c->fc, "track[%i].stts.entries = %i\n",
              c->fc->nb_streams-1, entries);
  
 -    if (!entries)
 -        return 0;
      if (entries >= UINT_MAX / sizeof(*sc->stts_data))
 -        return AVERROR(EINVAL);
 +        return -1;
  
+     av_free(sc->stts_data);
      sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data));
      if (!sc->stts_data)
          return AVERROR(ENOMEM);