aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-01-29 17:05:42 -0800
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-04-19 13:31:27 -0700
commit46f83e5b3c17a46fa9c86421e7b511cd00cb5d60 (patch)
tree4603b95601c1d3f82e98bfcbf9e8586d607b172d /libavcodec/libx264.c
parentd319064465e148b8adb53d1ea5d38c09f987056e (diff)
downloadffmpeg-46f83e5b3c17a46fa9c86421e7b511cd00cb5d60.tar.gz
In libx264 wrapper, do not set pic quality if no frame is output, avoids
uninitialized reads.
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index db57eead78..5b20d35464 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;
}