No, this is far from theoretical. Any invalid hex character will return -1 and thus cause things to go haywire.
You need to *either* check for -1 here or make sure that HexDigit returns 0 in case of an invalid hexchar. See my comment below.