[FFmpeg-cvslog] rv34: free+allocate buffer instead of reallocating it to preserve alignment

Kostya Shishkov git at videolan.org
Sat Aug 13 22:34:26 CEST 2011


ffmpeg | branch: master | Kostya Shishkov <kostya.shishkov at gmail.com> | Fri Aug 12 21:50:28 2011 +0200| [78622ef362c7c8d4606fe1a38f612f039413c7c3] | committer: Ronald S. Bultje

rv34: free+allocate buffer instead of reallocating it to preserve alignment

Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>

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

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

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index cdc559f..253c395 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1311,7 +1311,8 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
         if (!r->tmp_b_block_base || s->width != r->si.width || s->height != r->si.height) {
             int i;
 
-            r->tmp_b_block_base = av_realloc(r->tmp_b_block_base, s->linesize * 48);
+            av_free(r->tmp_b_block_base); //realloc() doesn't guarantee alignment
+            r->tmp_b_block_base = av_malloc(s->linesize * 48);
             for (i = 0; i < 2; i++)
                 r->tmp_b_block_y[i] = r->tmp_b_block_base + i * 16 * s->linesize;
             for (i = 0; i < 4; i++)



More information about the ffmpeg-cvslog mailing list