diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2011-01-30 04:05:42 +0300 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-11-05 16:18:32 +0400 |
commit | 7b733e4b7fd052170199ae29fa14e1e71ba95077 (patch) | |
tree | be637ba207bd183c8fffa688f4d41245e6ad82e6 /libavcodec | |
parent | e07086d8aed011544ee2fc71ebab867a38a6d6e7 (diff) |
libx264: do not set pic quality if no frame is output
Avoids uninitialized reads.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 5caa2de19ece830e32c95731bc92a423d55cff0c)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libx264.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index df7b2e806b..e247255ce5 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; } |