[Libav-user] sws_scale crash

wm4 nfxjfg at googlemail.com
Thu Jun 19 17:32:06 CEST 2014


On Thu, 19 Jun 2014 17:48:47 +1000
YIRAN LI <mrfun.china at gmail.com> wrote:

> Hi, I met a crash when using sws_scale. So I'd like to see if anyone can
> help me here.
> 
> The input is a 1754x789 RGB24 image and I want to scale to 1280x576
> 
> swscontext is created successfully.
> 
> I create my own buffer to hold the image data, because it's RGB24 so the
> byteswith is 5264 (16 aligned) so the whole buffer is 5264x789.
> 
> The input AVFrame for sws_scale is created using avcode_alloc_frame(), and
> data[0] points to the buffer linesize[0] = 5264, and the output AVFrame is
> created using avpicture_alloc(rbg24, 1280, 576).

Never use anything related to avpicture. Use av_frame_get_buffer().
Strange name, but it allocates image data for the currently set
AVFrame size/pixelformat.

> 
> with all above condition, sws_scale crashed. So I'd like to know if there's
> any special requirement on the input/out buffer of sws_scale?
> 
> Thanks



More information about the Libav-user mailing list