JBIG2Stream: Protect against yet another potential overflow

oss-fuzz/29335
7 jobs for 29335 in 6 minutes and 22 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #6503161
build

00:04:40

passed #6503166
build_android

00:00:50

passed #6503162
build_clang_libcpp

00:05:26

passed #6503165
build_clazy

00:06:21

passed #6503164
build_mingw64_fedora

00:03:30

passed #6503163
build_ubuntu_16_04

00:03:29

passed #6503160
clang_format

00:01:22