diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index a28a9894da32708935cbfc0f27de81a02e07ca97..3f18f64dccf07e0a920df54c6f78ce6493dfee5a 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -333,7 +333,7 @@ error:
         ret--;
     }
     free( buf );
-    return -1;
+    return VLC_EGENERIC;
 }
 
 int filter_chain_ForEach( filter_chain_t *chain,