keep nScanlineStride number sane

bff + valgrind

Change-Id: I255a052251a6a0f1e4005b9cfb3b6ce00c6653ee
(cherry picked from commit 35412949a2fb2a4472177a0289de4f0c062b674d)
Reviewed-on: https://gerrit.libreoffice.org/11162
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>