From 478203de36f03a4889699e193bd81d7fb4afbcd7 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sat, 22 Nov 2014 23:58:36 +0100 Subject: [PATCH] am7xxx-play: fix a possible case of use before initialization The got_packet variable is assigned inside an internal "if" of the while loop, but it is also used in the checks at the end of the while loop, and it is possible to get to this part before having ever assigned the variable, so in order to behave correctly initialize the variable before the loop starts. --- examples/am7xxx-play.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c index 2fa615a..5b2887d 100644 --- a/examples/am7xxx-play.c +++ b/examples/am7xxx-play.c @@ -354,6 +354,7 @@ static int am7xxx_play(const char *input_format_string, goto cleanup_out_buf; } + got_packet = 0; while (run) { /* read packet */ ret = av_read_frame(input_ctx.format_ctx, &in_packet); -- 2.1.4