aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenchint.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-22 15:05:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-22 15:05:35 +0200
commit63621762eccf4c825ef1d42251b0d45d0c498826 (patch)
treeb904274c767ccb7e8aa2e92d67be66d7ecf7ef4f /libavformat/movenchint.c
parent091ba02cc83610b329abc488d159bfb42cb77b49 (diff)
downloadffmpeg-63621762eccf4c825ef1d42251b0d45d0c498826.tar.gz
avformat/movenchint: only change queue size if reallocation succeeded
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenchint.c')
-rw-r--r--libavformat/movenchint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index 943680e9ad..b909748e41 100644
--- a/libavformat/movenchint.c
+++ b/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;