XRef::readXRef: Improve overflow check

oss-fuzz/11744
7 jobs for 11744 in 4 minutes and 53 seconds
Status Job ID Name Coverage
  Build
passed #6553138
build

00:03:07

passed #6553143
build_android

00:00:42

passed #6553139
build_clang_libcpp

00:04:53

passed #6553142
build_clazy

00:04:44

passed #6553141
build_mingw64_fedora

00:02:36

passed #6553140
build_ubuntu_16_04

00:01:24

passed #6553137
clang_format

00:01:15