flacdec: allocate sample buffers with av_malloc
authorMans Rullgard <mans@mansr.com>
Mon, 2 Jul 2012 22:16:30 +0000 (23:16 +0100)
committerMans Rullgard <mans@mansr.com>
Wed, 4 Jul 2012 02:30:01 +0000 (03:30 +0100)
The buffers are only allocated once, although it can happen from
any of a few different places, so there is no need to use realloc.
Using av_malloc() ensures they are aligned suitably for SIMD
optimisations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/flacdec.c

index da2202a..4b62ea8 100644 (file)
@@ -149,8 +149,7 @@ static void allocate_buffers(FLACContext *s)
     assert(s->max_blocksize);
 
     for (i = 0; i < s->channels; i++) {
-        s->decoded[i] = av_realloc(s->decoded[i],
-                                   sizeof(int32_t)*s->max_blocksize);
+        s->decoded[i] = av_malloc(sizeof(int32_t)*s->max_blocksize);
     }
 }