Browse Source

dct: Check memory allocation

tags/n2.7
Vittorio Giovara Luca Barbato 10 years ago
parent
commit
69277069dd
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/dct.c

+ 2
- 0
libavcodec/dct.c View File

@@ -191,6 +191,8 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)

s->costab = ff_cos_tabs[nbits + 2];
s->csc2 = av_malloc(n / 2 * sizeof(FFTSample));
if (!s->csc2)
return AVERROR(ENOMEM);

if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
av_free(s->csc2);


Loading…
Cancel
Save