[FFmpeg-cvslog] Use av_fast_malloc instead of av_fast_realloc.

Reimar Döffinger git at videolan.org
Sat May 7 10:41:26 CEST 2011


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sat May  7 09:58:38 2011 +0200| [f44967b1b548413830324f6c64f78032f9cbecc3] | committer: Reimar Döffinger

Use av_fast_malloc instead of av_fast_realloc.

Avoids a memleak, is less code and might be faster.

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

 libavcodec/svq3.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 7516606..a7e8065 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -949,8 +949,8 @@ static int svq3_decode_frame(AVCodecContext *avctx,
     s->mb_x = s->mb_y = h->mb_xy = 0;
 
     if (svq3->watermark_key) {
-        svq3->buf = av_fast_realloc(svq3->buf, &svq3->buf_size,
-                                    buf_size+FF_INPUT_BUFFER_PADDING_SIZE);
+        av_fast_malloc(&svq3->buf, &svq3->buf_size,
+                       buf_size+FF_INPUT_BUFFER_PADDING_SIZE);
         if (!svq3->buf)
             return AVERROR(ENOMEM);
         memcpy(svq3->buf, avpkt->data, buf_size);



More information about the ffmpeg-cvslog mailing list