Browse code

avfilter/curves: fix resource leaks.

Fixes CID1206650

Clément Bœsch authored on 2014/04/27 18:49:13
Showing 1 changed files
... ...
@@ -331,8 +331,10 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
331 331
         return ret;
332 332
 
333 333
 #define READ16(dst) do {                \
334
-    if (size < 2)                       \
335
-        return AVERROR_INVALIDDATA;     \
334
+    if (size < 2) {                     \
335
+        ret = AVERROR_INVALIDDATA;      \
336
+        goto end;                       \
337
+    }                                   \
336 338
     dst = AV_RB16(buf);                 \
337 339
     buf  += 2;                          \
338 340
     size -= 2;                          \