Here's an image which causes 4 GB to be allocated.
If you change a single byte in this image, then you can get qemu-img to crash with an allocation error:
00000000 4b 44 4d 56 01 00 00 00 03 00 00 00 01 00 ff ff |KDMV............| 00000010 ff ff 00 00 01 04 00 00 00 00 00 00 01 00 00 00 |................| ^ +--- this byte to 0
Here's an image which causes 4 GB to be allocated.
If you change a single byte in this image, then you can get qemu-img to crash with an allocation error:
00000000 4b 44 4d 56 01 00 00 00 03 00 00 00 01 00 ff ff |KDMV............|
^
+--- this byte to 0
00000010 ff ff 00 00 01 04 00 00 00 00 00 00 01 00 00 00 |................|