[FFmpeg-devel] libx264.c bug?

Michael Niedermayer michaelni at gmx.at
Tue Oct 4 23:15:05 CEST 2011

On Tue, Oct 04, 2011 at 08:02:07PM +0000, C Chatterjee wrote:
> Noticed an issue with the X264_frame() function in libx264.c in libavcodec in the 0.8.5 release.
> The do-while() loop below:
>    do {
>     if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
>         return -1;
>     bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0);
>     if (bufsize < 0)
>         return -1;
>     } while (!bufsize && !frame && x264_encoder_delayed_frames(x4->enc));
> bufsize returned by encode_nals(() is the buffer used. If it does not use any buffer it returns 0. So bufsize=0 at the end of thisiteration.
> Next iteration it uses bufsize=0 as an argument to encode_nals(). Clearly this is a problem.
> Did I miss something?

no, issue confirmed, ill fix it in a moment in git master, will be
in the next release.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111004/673d6a72/attachment.asc>

More information about the ffmpeg-devel mailing list