Opened 7 years ago

Last modified 6 years ago

#622 closed defect

swscale crash when convert PIX_FMT_YUV420P -> PIX_FMT_YUVJ420P — at Initial Version

Reported by: kyh96403 Owned by: michael
Priority: important Component: swscale
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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 (0)

Note: See TracTickets for help on using tickets.