fix crash during file format detection, related #i101863#

Change-Id: I2aec2e95f49ab70a9e94c5d52f70855f4381a24e
Reviewed-on: https://gerrit.libreoffice.org/7986
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>