avcodec/ac3enc_template: Use FF_ALLOC_ARRAY_OR_GOTO()
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Sep 2014 13:06:28 +0000 (15:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Sep 2014 13:18:29 +0000 (15:18 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ac3enc_template.c

index 192d16f57e387b90968222499b11998cced7c494..29e2381c9dfa08ce5f6b49f7675c15c96405a0e3 100644 (file)
@@ -57,7 +57,7 @@ int AC3_NAME(allocate_sample_buffers)(AC3EncodeContext *s)
 
     FF_ALLOC_OR_GOTO(s->avctx, s->windowed_samples, AC3_WINDOW_SIZE *
                      sizeof(*s->windowed_samples), alloc_fail);
-    FF_ALLOC_OR_GOTO(s->avctx, s->planar_samples, s->channels * sizeof(*s->planar_samples),
+    FF_ALLOC_ARRAY_OR_GOTO(s->avctx, s->planar_samples, s->channels, sizeof(*s->planar_samples),
                      alloc_fail);
     for (ch = 0; ch < s->channels; ch++) {
         FF_ALLOCZ_OR_GOTO(s->avctx, s->planar_samples[ch],