libx264: do not set pic quality if no frame is output
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 30 Jan 2011 01:05:42 +0000 (17:05 -0800)
committerAnton Khirnov <anton@khirnov.net>
Mon, 8 Aug 2011 12:33:09 +0000 (14:33 +0200)
Avoids uninitialized reads.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/libx264.c

index 17cae71..bcf8b1f 100644 (file)
@@ -144,7 +144,8 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
     }
 
     x4->out_pic.key_frame = pic_out.b_keyframe;
     }
 
     x4->out_pic.key_frame = pic_out.b_keyframe;
-    x4->out_pic.quality   = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
+    if (bufsize)
+        x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
 
     return bufsize;
 }
 
     return bufsize;
 }