[FFmpeg-trac] #1982(swscale:new): Segmentation fault on sws_scale call
FFmpeg
trac at avcodec.org
Sat Dec 1 16:17:51 CET 2012
#1982: Segmentation fault on sws_scale call
----------------------------------+--------------------------------------
Reporter: goodvinj | Type: defect
Status: new | Priority: critical
Component: swscale | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+--------------------------------------
I use the following code to convert BGRA image to YUV420P, but application
crashes on sws_scale.
OS: Linux, Arch: ARMv7
{{{
SwsContext *pImgConvertCtx = sws_getContext(
frame->width, frame->height,
srcFormat,
frame->width, frame->height,
destFormat,
SWS_FAST_BILINEAR, NULL, NULL, NULL);
// Convert RGB to YUV.
if (pImgConvertCtx)
{
sws_scale(pImgConvertCtx, (const uint8_t * const
*)frame->data, frame->linesize,
0, frame->height, pCurrentPicture->data,
pCurrentPicture->linesize);
sws_freeContext(pImgConvertCtx);
}
}}}
where "srcFormat" is BGRA, "destFormat" is YUV420P, width is 800, height
is 1300.
"pCurrentPicture" allocated via:
{{{
AVFrame * picture = avcodec_alloc_frame();
if (!picture)
return NULL;
avpicture_alloc((AVPicture *)picture, pix_fmt, nWidth, nHeight);
}}}
"frame" allocated via avpicture_fill from BGRA image data.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1982>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list