Coverity scan fixes CID : 982031 through 982054

git-svn-id: svn://dev.exiv2.org/svn@3279 b7c8b350-86e7-0310-a4b4-de8f6a8f16a3
Coverity scan fixes CID : 981999 (size overflow warning : typecasted) and 981993( divided by zeor warning : added check beore operation)

git-svn-id: svn://dev.exiv2.org/svn@3280 b7c8b350-86e7-0310-a4b4-de8f6a8f16a3