On 2026-09-12T12:44:46, Aristo Chen <[email protected]> wrote:
> tools: mkimage: include image-data sharers in the load overlap check
>
> The overlap check at the end of fit_import_data() sizes each referenced
> image from its data property and skips images without data, since such
> images are never copied anywhere. That assumption no longer holds for
> an image that shares another image's data through image-data: the
> reference is resolved only after the import, so the image has no data
> yet when the check runs and escaped it entirely, leaving its load
> region unvalidated even though the resolved image is loaded like any
> other.
>
> Size such images from their target's data instead. References that do
> not resolve are left alone here; fit_resolve_image_data() rejects them
> right after the import.
>
> Signed-off-by: Aristo Chen <[email protected]>
>
> tools/fit_image.c | 38 +++++++++++++++++++++++++++++++++++---
>  1 file changed, 35 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to