On Tue, 7 Apr 2015, Vittorio Giovara wrote:

On Fri, Apr 3, 2015 at 4:12 PM, Himangi Saraogi <[email protected]> wrote:
---
This fixes CID 1292529.

 libavfilter/filtfmts.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/libavfilter/filtfmts.c b/libavfilter/filtfmts.c
index 40649c7..cc04654 100644
--- a/libavfilter/filtfmts.c
+++ b/libavfilter/filtfmts.c
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
     AVFilterGraph *graph_ctx;
     const char *filter_name;
     const char *filter_args = NULL;
-    int i, j;
+    int i, j, ret = 0;

     av_log_set_level(AV_LOG_DEBUG);

@@ -74,11 +74,21 @@ int main(int argc, char **argv)
     /* create a link for each of the input pads */
     for (i = 0; i < filter_ctx->nb_inputs; i++) {
         AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
+        if (!link) {
+            fprintf(stderr, "Unable to allocate memory for filter input 
link\n");
+            ret = 1;

Is there any particular reason for returning a positive value? To my
understanding when returning from main 0 means success, >0 warning, <0
failure.

I haven't ever heard of such a convention, where did you get that? Zero is success, anything else is a failure. And returning negative values gets them mapped into the same range as is used for hard termination by signals.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to