aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-04 23:21:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-04 23:21:52 +0200
commit751a4efd4d754b15ebc6027b09051f27860bb1e8 (patch)
treee0b80d99cdb048e064ab5b01b7da1cbff2b4cbc3
parent26c7ff9317352fa2113e6b85b1c9a7a9c6d3f709 (diff)
downloadffmpeg-751a4efd4d754b15ebc6027b09051f27860bb1e8.tar.gz
libx264: Fix loop failure due to bufsize becoming 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/libx264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 94ca057212..c1aab6cf15 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -127,13 +127,14 @@ static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size,
}
static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
- int bufsize, void *data)
+ int orig_bufsize, void *data)
{
X264Context *x4 = ctx->priv_data;
AVFrame *frame = data;
x264_nal_t *nal;
int nnal, i;
x264_picture_t pic_out;
+ int bufsize;
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = X264_CSP_I420;
@@ -164,6 +165,7 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
}
do {
+ bufsize = orig_bufsize;
if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
return -1;