OSDN Git Service

Prevent division by 0
authorAlexis Hetu <sugoi@google.com>
Wed, 27 Sep 2017 18:43:38 +0000 (14:43 -0400)
committerAlexis Hétu <sugoi@google.com>
Fri, 29 Sep 2017 21:31:50 +0000 (21:31 +0000)
commit444b04ad7419efdaaad3a0caa0077eadca18c89f
tree73a8a7fd0e5baf23220b850ba9cd1e32a4c358ca
parent560232a6ccf18d08aadb64cf2fd3349f789813ff
Prevent division by 0

If imageSize is 0, inputPitch may be 0, which would cause a division
by 0. In any case, if imageSize is 0, there's no work to perform, so
we just skip loadCompressedData() entirely in that case.

Bug:765094

Change-Id: Iedc6516ef6d025d24a8827597045cb3b83599e4a
Reviewed-on: https://swiftshader-review.googlesource.com/12648
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
src/OpenGL/libGL/Texture.cpp
src/OpenGL/libGLES_CM/Texture.cpp
src/OpenGL/libGLESv2/Texture.cpp