aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dct.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-05-31 14:53:31 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-05-31 15:03:30 +0200
commit69277069dd225f5ae02f0215e877a06522d834d3 (patch)
treee15d3c086d01810cb0b146555a24f4eaf5bc08cd /libavcodec/dct.c
parente524f37356156893cae50fc46451bd4a6198703d (diff)
downloadffmpeg-69277069dd225f5ae02f0215e877a06522d834d3.tar.gz
dct: Check memory allocation
Diffstat (limited to 'libavcodec/dct.c')
-rw-r--r--libavcodec/dct.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index 4dbbff867b..180477e621 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -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);