[FFmpeg-cvslog] In libx264 wrapper, do not set pic quality if no frame is output, avoids

Baptiste Coudurier git at videolan.org
Tue Apr 19 22:32:14 CEST 2011


ffmpeg | branch: master | Baptiste Coudurier <baptiste.coudurier at gmail.com> | Sat Jan 29 17:05:42 2011 -0800| [46f83e5b3c17a46fa9c86421e7b511cd00cb5d60] | committer: Baptiste Coudurier

In libx264 wrapper, do not set pic quality if no frame is output, avoids
uninitialized reads.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46f83e5b3c17a46fa9c86421e7b511cd00cb5d60
---

 libavcodec/libx264.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index db57eea..5b20d35 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -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;
 }



More information about the ffmpeg-cvslog mailing list