Fix remaining audit issues
Fix parsing and validation errors
Updated dump_data() to take size_t.
Added bounds check for palette tRNS entries.
Fixed the memory leak in collect_data()...
Applied isspace cassts to avoid UB on signed chracters.
Applied isspace cassts to avoid UB on signed chracters.
Added a NULL guard in safeprint() so callers can safely pass NULL strings.