- MyAllocBitMap left bm->bm.Planes[] uninitialized; InitBitMap only
fills BytesPerRow/Rows/Flags/Depth, not Planes[]. If AllocRaster
fails mid-loop, MyFreeBitMap was iterating up to Depth and would
pass uninitialized stack-garbage pointers to FreeRaster. Zero
Planes[] before the alloc loop.
- ReadImageFile leaked iffparse.library, the IFFHandle, the DOS file
handle, and any open-IFF state on every panic path. On AmigaOS
those handles are not auto-reclaimed when the process dies, so
each failure stranded resources until reboot. Restructure to a
single cleanup label and free in reverse-acquisition order before
panicking.
- OpenIFF returns an error code that was being thrown away, so a
failed open would feed corrupt state to ParseIFF. Check and
bail.