Commit 0a8d3d11 by Nicolas Capens

Fix potential division by zero.

Bug 25351344 Change-Id: Iaf0ce657a3a98c9b70902240340ed5f3f8076281 Reviewed-on: https://swiftshader-review.googlesource.com/4769Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 043c19f0
...@@ -1169,9 +1169,9 @@ namespace sw ...@@ -1169,9 +1169,9 @@ namespace sw
external.format = format; external.format = format;
external.bytes = bytes(external.format); external.bytes = bytes(external.format);
external.pitchB = pitch; external.pitchB = pitch;
external.pitchP = pitch / external.bytes; external.pitchP = external.bytes ? pitch / external.bytes : 0;
external.sliceB = slice; external.sliceB = slice;
external.sliceP = slice / external.bytes; external.sliceP = external.bytes ? slice / external.bytes : 0;
external.lock = LOCK_UNLOCKED; external.lock = LOCK_UNLOCKED;
external.dirty = true; external.dirty = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment