[FFmpeg-cvslog] libx264: do not set pic quality if no frame is output
Baptiste Coudurier
git at videolan.org
Sun Dec 25 01:35:58 CET 2011
ffmpeg | branch: release/0.6 | Baptiste Coudurier <baptiste.coudurier at gmail.com> | Sat Jan 29 17:05:42 2011 -0800| [7b733e4b7fd052170199ae29fa14e1e71ba95077] | committer: Reinhard Tartler
libx264: do not set pic quality if no frame is output
Avoids uninitialized reads.
Signed-off-by: Anton Khirnov <anton at khirnov.net>
(cherry picked from commit 5caa2de19ece830e32c95731bc92a423d55cff0c)
Signed-off-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b733e4b7fd052170199ae29fa14e1e71ba95077
---
libavcodec/libx264.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index df7b2e8..e247255 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -127,7 +127,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