avutil/fixed_dsp: Check for av_malloc() failure
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2015 15:26:53 +0000 (16:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2015 15:27:28 +0000 (16:27 +0100)
Fixes CID1271051

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/fixed_dsp.c

index 102a951..9f2e841 100644 (file)
@@ -91,6 +91,10 @@ static void vector_fmul_window_fixed_c(int32_t *dst, const int32_t *src0,
 AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
 {
     AVFixedDSPContext * fdsp = av_malloc(sizeof(AVFixedDSPContext));
+
+    if (!fdsp)
+        return NULL;
+
     fdsp->vector_fmul_window_scaled = vector_fmul_window_fixed_scaled_c;
     fdsp->vector_fmul_window = vector_fmul_window_fixed_c;