Don't malloc distance fields with 0 bytes


Amends d4decd81d1b66717f90050930d42a1b2af2f3bd7.

In theory, you could get QDistanceField to malloc(0) by passing in
a null size to it. It is used from the distance field cache where
such glyphs are never entered into the cache, so it does not happen
in practice, but it makes sense to protect against in the core API.

Note: Pre-existing issue, but triggered an issue in the static code
analysis when it was modified.

Pick-to: 6.12
Change-Id: I1b19dd3b5ebaf957c179b75193d5174f78f8409b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
commitafeb181a7ac121a60fea10dc06a4da8d6fc42d4e
parent6490e51cf086a25f4aba48e18fe544144c73bec8
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
commit timeTue, 20 Oct 2026 09:59:25 +0000