From b19775ece86f40df15ffadcb358c8896bc847482 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 20 Mar 2012 22:59:03 +0100 Subject: [PATCH] examples: set proper return codes in am7xxx-play Set the return codes explicitly on the error path of functions not returning an int error value. --- examples/am7xxx-play.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index a661758..56fd8b2 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -291,6 +291,7 @@ static int am7xxx_play(const char *input_format_string, picture_raw = avcodec_alloc_frame(); if (picture_raw == NULL) { fprintf(stderr, "cannot allocate the raw picture frame!"); + ret = -ENOMEM; goto cleanup_output; } @@ -298,6 +299,7 @@ static int am7xxx_play(const char *input_format_string, picture_scaled = avcodec_alloc_frame(); if (picture_scaled == NULL) { fprintf(stderr, "cannot allocate the scaled picture!\n"); + ret = -ENOMEM; goto cleanup_picture_raw; } @@ -308,6 +310,7 @@ static int am7xxx_play(const char *input_format_string, out_buf = av_malloc(out_buf_size * sizeof(uint8_t)); if (out_buf == NULL) { fprintf(stderr, "cannot allocate output data buffer!\n"); + ret = -ENOMEM; goto cleanup_picture_scaled; } @@ -329,6 +332,7 @@ static int am7xxx_play(const char *input_format_string, NULL, NULL, NULL); if (sw_scale_ctx == NULL) { fprintf(stderr, "cannot set up the rescaling context!\n"); + ret = -EINVAL; goto cleanup_out_buf; } -- 2.1.4