qga: fix off-by-one length check