aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/image-fit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/image-fit.c b/common/image-fit.c
index f3bb00c98a5..4435bc4f1d9 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1011,8 +1011,10 @@ int fit_image_get_data_and_size(const void *fit, int noffset,
if (external_data) {
debug("External Data\n");
ret = fit_image_get_data_size(fit, noffset, &len);
- *data = fit + offset;
- *size = len;
+ if (!ret) {
+ *data = fit + offset;
+ *size = len;
+ }
} else {
ret = fit_image_get_data(fit, noffset, data, size);
}