Spotted by oss-fuzz using asan. oss-fuzz#13271 Signed-off-by: Philip Withnall <withnall@endlessm.com>