Browse Source

cngdec: Fix the memset size to cover the full array

This was a leftover from previous iterations of the code, where the
refl coef arrays were statically allocated.

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n1.1
Martin Storsjö 12 years ago
parent
commit
cafefd889b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/cngdec.c

+ 1
- 1
libavcodec/cngdec.c View File

@@ -108,7 +108,7 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
if (avpkt->size) {
float dbov = -avpkt->data[0] / 10.0;
p->target_energy = 1081109975 * pow(10, dbov) * 0.75;
memset(p->target_refl_coef, 0, sizeof(p->refl_coef));
memset(p->target_refl_coef, 0, p->order * sizeof(*p->target_refl_coef));
for (i = 0; i < FFMIN(avpkt->size - 1, p->order); i++) {
p->target_refl_coef[i] = (avpkt->data[1 + i] - 127) / 128.0;
}


Loading…
Cancel
Save