id,summary,reporter,owner,description,type,status,priority,component,version,resolution,keywords,cc,blockedby,blocking,reproduced,analyzed
1982,Segmentation fault on sws_scale call,goodvinj,,"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.
",defect,closed,normal,swscale,git-master,invalid,,,,,0,0
