[FFmpeg-cvslog] dct: Check memory allocation

Vittorio Giovara git at videolan.org
Mon Jun 1 01:52:09 CEST 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Sun May 31 14:53:31 2015 +0200| [69277069dd225f5ae02f0215e877a06522d834d3] | committer: Luca Barbato

dct: Check memory allocation

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69277069dd225f5ae02f0215e877a06522d834d3
---

 libavcodec/dct.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index 4dbbff8..180477e 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);



More information about the ffmpeg-cvslog mailing list