fdo#78906 : File crashes while opening.

Handled a memory corruption.

Change-Id: I195d17bcd0a9a86bcc96cc7ad14f1d5f2908cf8c
Reviewed-on: https://gerrit.libreoffice.org/9545
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>