[x264-devel] x264 version 104 crash

Jason Garrett-Glaser darkshikari at gmail.com
Thu Jul 15 11:22:35 CEST 2010


On Wed, Jul 14, 2010 at 10:53 PM, 191919 <191919 at gmail.com> wrote:
> I noticed x264.h was versioned up to 104, but some APIs, like
> x264_picture_alloc, are not used anymore.
>
> And sadly, my code is not working anymore. Basically, I copied the code from
> x264.c, but x264.c changed a lot, I need modify many lines to follow up.

>     codec->pic = (x264_picture_t*) calloc(1, sizeof(x264_picture_t));
>     x264_picture_init(codec->pic);
>     x264_picture_alloc(codec->pic, params.i_csp, params.i_width,
> params.i_height);
>
> === Encoding, the input buffer is in YV12 ===
>
>         codec->pic->img.plane[0] = codec->yuv_buffer;
>         codec->pic->img.plane[1] = codec->pic->img.plane[0] +
> frame_param->height * frame_param->width;
>         codec->pic->img.plane[2] = codec->pic->img.plane[0] +
> frame_param->height * frame_param->width + frame_param->height *
> frame_param->width / 4;

Your code is incorrect.  It *both* allocates *and* assigns pointers.
It should be doing only one of the two.

Dark Shikari


More information about the x264-devel mailing list