[FFmpeg-cvslog] libx264: Fix loop failure due to bufsize becoming 0

Michael Niedermayer git at videolan.org
Fri Nov 4 20:49:17 CET 2011


ffmpeg | branch: release/0.7 | Michael Niedermayer <michaelni at gmx.at> | Tue Oct  4 23:21:52 2011 +0200| [e49abd1d92f4ef2258c82f233e138901839eee0c] | committer: Michael Niedermayer

libx264: Fix loop failure due to bufsize becoming 0

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 751a4efd4d754b15ebc6027b09051f27860bb1e8)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e49abd1d92f4ef2258c82f233e138901839eee0c
---

 libavcodec/libx264.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index bf542ac..6477f3f 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -101,13 +101,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;
@@ -138,6 +139,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;
 



More information about the ffmpeg-cvslog mailing list