avformat/movenchint: only change queue size if reallocation succeeded

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/36/head
Michael Niedermayer 11 years ago
parent 091ba02cc8
commit 63621762ec
  1. 4
      libavformat/movenchint.c

@ -105,10 +105,10 @@ static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size,
return;
if (!queue->samples || queue->len >= queue->size) {
HintSample *samples;
queue->size += 10;
samples = av_realloc(queue->samples, sizeof(HintSample)*queue->size);
samples = av_realloc(queue->samples, sizeof(HintSample) * (queue->size + 10));
if (!samples)
return;
queue->size += 10;
queue->samples = samples;
}
queue->samples[queue->len].data = data;

Loading…
Cancel
Save