From 081e91d5a7631867606609fae0cb861abd5586b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 18 Dec 2007 21:31:09 +0100 Subject: Use an automatic array rather than malloc'ing and free'ing it on the function. --- src/demuxers/demux_asf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 889299beb..f5091035b 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -612,14 +612,14 @@ static int demux_asf_send_headers_common (demux_asf_t *this) { } static void asf_reorder(demux_asf_t *this, uint8_t *src, int len){ - uint8_t *dst = malloc(len); + uint8_t dst[len]; uint8_t *s2 = src; int i = 0, x, y; while(len-i >= this->reorder_h * this->reorder_w*this->reorder_b){ for(x = 0; x < this->reorder_w; x++) for(y = 0; y < this->reorder_h; y++){ - memcpy(dst + i, s2 + (y * this->reorder_w+x) * this->reorder_b, + memcpy(&dst[i], s2 + (y * this->reorder_w+x) * this->reorder_b, this->reorder_b); i += this->reorder_b; } @@ -627,7 +627,6 @@ static void asf_reorder(demux_asf_t *this, uint8_t *src, int len){ } xine_fast_memcpy(src,dst,i); - free(dst); } /* redefine abs as macro to handle 64-bit diffs. -- cgit v1.2.3