lv_img_dsc_t 创建问题

LV_IMG_DECLARE(img_cogwheel_argb);
uint32_t datasize = 100 * 100 * 4;
uint8_t *data = (uint8_t *)malloc(datasize);
// CameraFrameThread::getInstance()->getFrameData(data);
memcpy(data, img_cogwheel_argb.data, img_cogwheel_argb.data_size);
ImageBox *img_ptr = getWidgetByName(“img_video”);

if (img_dsc != nullptr)
{
	// img_dsc->data = img_cogwheel_argb.data;
	img_dsc->data = data;
	Info("b%d g%d,r%d,a%d", img_dsc->data[0], img_dsc->data[1], img_dsc->data[2], img_dsc->data[3]);
	img_dsc->data_size = datasize;
	img_dsc->header.always_zero = 0,
	img_dsc->header.w = 100;
	img_dsc->header.h = 100;
	img_dsc->header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA;
	img_ptr->setImageSrc(img_dsc);
}
free(data);

上述代码,使用注释时能够正常显示img_cogwheel_argb,但是一旦memcpy到data中以后使用data就无法显示,这是为什么

自己找到了,data被free掉了