In libx264 wrapper, do not set pic quality if no frame is output, avoids
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 30 Jan 2011 01:05:42 +0000 (17:05 -0800)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 19 Apr 2011 20:31:27 +0000 (13:31 -0700)
uninitialized reads.

libavcodec/libx264.c

index db57eea..5b20d35 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.quality   = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
+    if (bufsize)
+        x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
 
     return bufsize;
 }