avfilter/curves: fix resource leaks.
authorClément Bœsch <u@pkh.me>
Sun, 27 Apr 2014 09:49:13 +0000 (11:49 +0200)
committerClément Bœsch <u@pkh.me>
Sun, 27 Apr 2014 09:49:13 +0000 (11:49 +0200)
Fixes CID1206650

libavfilter/vf_curves.c

index 93799b0..b17c391 100644 (file)
@@ -331,8 +331,10 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
         return ret;
 
 #define READ16(dst) do {                \
-    if (size < 2)                       \
-        return AVERROR_INVALIDDATA;     \
+    if (size < 2) {                     \
+        ret = AVERROR_INVALIDDATA;      \
+        goto end;                       \
+    }                                   \
     dst = AV_RB16(buf);                 \
     buf  += 2;                          \
     size -= 2;                          \