libdocument: Check for integer overflows when thumbnailing
@tobiasmue
Submitted by Tobias Mueller Link to original bug (#786414)
Description
When compiling with -Wconversion GCC has some complaints. These patches address some of those.