aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-01-29 17:05:42 -0800
committerAnton Khirnov <anton@khirnov.net>2011-08-08 14:33:09 +0200
commit5caa2de19ece830e32c95731bc92a423d55cff0c (patch)
tree5ad392eaf4163592560092b42737a651e73d49a8
parent07a227b432e49f4c0f35bbef48009f4d8438b32e (diff)
downloadffmpeg-5caa2de19ece830e32c95731bc92a423d55cff0c.tar.gz
libx264: do not set pic quality if no frame is output
Avoids uninitialized reads. Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/libx264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 17cae713ef..bcf8b1f688 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;
}