Opened 11 years ago

Closed 11 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

Description

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.

Change History (4)

comment:1 by Carl Eugen Hoyos, 11 years ago

Priority: criticalnormal

Please provide source code that allows to reproduce the problem and backtrace etc. as explained on http://ffmpeg.org/bugreports.html

comment:2 by reimar, 11 years ago

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

comment:3 by GoodvinJ, 11 years ago

Sorry, there was my issue in the code.

comment:4 by Carl Eugen Hoyos, 11 years ago

Resolution: invalid
Status: newclosed

Thank you for clarifying.

Note: See TracTickets for help on using tickets.