[x264-devel] x264 version 104 crash
191919
191919 at gmail.com
Thu Jul 15 16:08:58 CEST 2010
Thanks for your reply. I took a look at commons/common.c in which
x264_picture_alloc is implemented. Yes you are right, I did
double-allocate the yuv buffer, but I don't think this is the cause of
the library crash.
I have removed the redundant memory allocations (thank you!), the
result is same: my program crashed in x264_encoder_encode().
2010/7/15 Jason Garrett-Glaser <darkshikari at gmail.com>
>
> 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
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel
More information about the x264-devel
mailing list