Resolves: fdo#85032 max len property of -1 -> crash

Change-Id: Ief903c619204f01784e93fd5e2d582632cef032e
(cherry picked from commit e45136f1ff9d817dfec27a6a20ba29fffc6c54bf)
Reviewed-on: https://gerrit.libreoffice.org/11987
Reviewed-by: Matthew Francis <mjay.francis@gmail.com>
Tested-by: Matthew Francis <mjay.francis@gmail.com>
Reviewed-by: Joren De Cuyper <jorendc@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>