Commit 1490007c authored by Frank Li's avatar Frank Li

Fix crash for some imx6/7's image

imx6/7 bootdata.size in ivt header may bigger than file size

Only need download file size data in such case
Signed-off-by: default avatarFrank Li <>
parent 87489e01
......@@ -222,6 +222,11 @@ int SDPWriteCmd::run(CmdCtx*ctx)
//size = fbuff->size() - off;
size = pDB->ImageSize;
//ImageSize may be bigger than Imagesize because ImageSize include IVT offset
//Difference boot storage have difference IVT offset.
if (size > fbuff->size() - off)
size = fbuff->size() - off;
pbuff = (uint8_t*)pIvt;
return run(ctx, pbuff + offset, size, m_download_addr);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment