Opened 6 years ago

Closed 6 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 Changed 6 years ago by cehoyos

  • Priority changed from critical to normal

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

comment:2 Changed 6 years ago by reimar

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

comment:3 Changed 6 years ago by goodvinj

Sorry, there was my issue in the code.

comment:4 Changed 6 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

Thank you for clarifying.

Note: See TracTickets for help on using tickets.