Opened 9 years ago

Closed 9 years ago

#1982 closed defect (invalid)

Segmentation fault on sws_scale call

Reported by: GoodvinJ Owned by:
Priority: normal Component: swscale
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


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,
		frame->width, frame->height,
	// Convert RGB to YUV.
	if (pImgConvertCtx)
		sws_scale(pImgConvertCtx, (const uint8_t * const *)frame->data, frame->linesize,
			0, frame->height, pCurrentPicture->data, pCurrentPicture->linesize);

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.

Change History (4)

comment:1 by Carl Eugen Hoyos, 9 years ago

Priority: criticalnormal

Please provide source code that allows to reproduce the problem and backtrace etc. as explained on

comment:2 by reimar, 9 years ago

And in this case: check and report if the code works fine on other architectures like x86.

comment:3 by GoodvinJ, 9 years ago

Sorry, there was my issue in the code.

comment:4 by Carl Eugen Hoyos, 9 years ago

Resolution: invalid
Status: newclosed

Thank you for clarifying.

Note: See TracTickets for help on using tickets.