[FFmpeg-cvslog] avformat/movenchint: only change queue size if reallocation succeeded

Michael Niedermayer git at videolan.org
Sun Sep 22 15:52:04 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Sep 22 15:05:35 2013 +0200| [63621762eccf4c825ef1d42251b0d45d0c498826] | committer: Michael Niedermayer

avformat/movenchint: only change queue size if reallocation succeeded

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63621762eccf4c825ef1d42251b0d45d0c498826
---

 libavformat/movenchint.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index 943680e..b909748 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;



More information about the ffmpeg-cvslog mailing list