Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#622 closed defect (needs_more_info)

swscale crash when convert PIX_FMT_YUV420P -> PIX_FMT_YUVJ420P

Reported by: K.Y.H Owned by: Michael Niedermayer
Priority: important Component: swscale
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

swscale is crash below code.

#include <stdio.h>
#include <libswscale/swscale.h>

int main()
{
	int ww = 624; // crash
	int hh = 352;
//	int ww = 48; // crash
//	int hh = 48;
//	int ww = 64; // not crash
//	int hh = 64;
	int SwsFlag = SWS_POINT | SWS_ACCURATE_RND;
	struct SwsContext *context = NULL;
	uint8_t *src_data[4], *dst_data[4];
	int src_pitch[4], dst_pitch[4];

	context = sws_getCachedContext(context, ww, hh, PIX_FMT_YUV420P, ww, hh, PIX_FMT_YUVJ420P, SwsFlag, NULL, NULL, NULL);
	src_data[0] = av_malloc(ww * hh);
	src_data[1] = av_malloc(ww * hh / 4);
	src_data[2] = av_malloc(ww * hh / 4);
	src_data[3] = NULL;
	dst_data[0] = av_malloc(ww * hh);
	dst_data[1] = av_malloc(ww * hh / 4);
	dst_data[2] = av_malloc(ww * hh / 4);
	dst_data[3] = NULL;
	src_pitch[0] = ww;
	src_pitch[1] = ww / 2;
	src_pitch[2] = ww / 2;
	src_pitch[3] = 0;
	dst_pitch[0] = ww;
	dst_pitch[1] = ww / 2;
	dst_pitch[2] = ww / 2;
	dst_pitch[3] = 0;

	sws_scale(context, src_data, src_pitch, 0, hh, dst_data, dst_pitch);

	return 0;
}

Change History (4)

comment:1 by Michael Niedermayer, 12 years ago

Resolution: worksforme
Status: newclosed

No crash here (on linux) and nothing really suspicious under valgrind.
If the crash is still happening for you, please provide full gdb output and information about the platform and hardware on which it is crashing.

comment:2 by Michael Niedermayer, 12 years ago

Keywords: swscale added; sescale removed

comment:3 by Elon Musk, 11 years ago

Resolution: worksformeneeds_more_info

comment:4 by Carl Eugen Hoyos, 11 years ago

Description: modified (diff)
Keywords: swscale removed
Note: See TracTickets for help on using tickets.