diff options
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/loader.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c index c3c28cf6af..6875b7ecf3 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -814,9 +814,6 @@ int rom_copy(uint8_t *dest, hwaddr addr, size_t size) if (rom->addr > end) { break; } - if (!rom->data) { - continue; - } d = dest + (rom->addr - addr); s = rom->data; @@ -826,7 +823,9 @@ int rom_copy(uint8_t *dest, hwaddr addr, size_t size) l = dest - d; } - memcpy(d, s, l); + if (l > 0) { + memcpy(d, s, l); + } if (rom->romsize > rom->datasize) { /* If datasize is less than romsize, it means that we didn't |