libavcodec/a64multienc.c: In function ‘a64multi_encode_frame’:
libavcodec/a64multienc.c:342:17: warning: ‘buf’ may be used uninitialized in 
this function [-Wuninitialized]

The compiler has trouble to figure out that the if block
if (c->mc_frame_counter == c->mc_lifetime) {
never should be entered with both values being 0. So add
an explicit check on one of the parameters.
---
 libavcodec/a64multienc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index c9d3b3c..9d3dca5 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -304,7 +304,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
     }
 
     /* lifetime reached so now convert X frames at once */
-    if (c->mc_frame_counter == c->mc_lifetime) {
+    if ((c->mc_frame_counter == c->mc_lifetime) && c->mc_lifetime) {
         req_size = 0;
         /* any frames to encode? */
         if (c->mc_lifetime) {
-- 
1.7.9.5

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

Reply via email to