avutil/eval: check for av_malloc failure
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 1 Apr 2015 13:45:37 +0000 (15:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 1 Apr 2015 13:59:58 +0000 (15:59 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/eval.c

index ea31856..1dfcbef 100644 (file)
@@ -692,6 +692,10 @@ int av_expr_parse(AVExpr **expr, const char *s,
         goto end;
     }
     e->var= av_mallocz(sizeof(double) *VARS);
+    if (!e->var) {
+        ret = AVERROR(ENOMEM);
+        goto end;
+    }
     *expr = e;
     e = NULL;
 end: