Bug #87954

Division by zero in GraphicalFunctions class when image is scaled but input dimensions are zero

Added by Claus Due 3 months ago. Updated 20 days ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Image Generation / GIFBUILDER
Target version:
-
Start date:
2019-03-19
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The method which scales images lacks guard clauses to protect against division by zero if, for whatever reason (getimagesize return value, improper configuration for desired width/height, etc.) the input dimensions are zero.

Associated revisions

Revision a3b2904c (diff)
Added by Claus Due 20 days ago

[BUGFIX] Prevent division by zero when scaling image

Prevents multiple division by zero errors when scaling
images, by checking that the input image size is valid
(meaning non-zero) before attempting to calculate
the ratio for scaling - because the ratio is based on the
input size parameters that must not be zero.

Change-Id: I33fd3e49a1b3dcdc319309af736a9d785130af94
Releases: master, 9.5, 8.7
Resolves: #87954
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60299
Tested-by: Daniel Goerz <>
Tested-by: TYPO3com <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Oliver Hader <>
Reviewed-by: Anja Leichsenring <>

Revision 8b01570b (diff)
Added by Claus Due 20 days ago

[BUGFIX] Prevent division by zero when scaling image

Prevents multiple division by zero errors when scaling
images, by checking that the input image size is valid
(meaning non-zero) before attempting to calculate
the ratio for scaling - because the ratio is based on the
input size parameters that must not be zero.

Change-Id: I33fd3e49a1b3dcdc319309af736a9d785130af94
Releases: master, 9.5, 8.7
Resolves: #87954
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60883
Tested-by: TYPO3com <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Anja Leichsenring <>

Revision 018fa63c (diff)
Added by Claus Due 20 days ago

[BUGFIX] Prevent division by zero when scaling image

Prevents multiple division by zero errors when scaling
images, by checking that the input image size is valid
(meaning non-zero) before attempting to calculate
the ratio for scaling - because the ratio is based on the
input size parameters that must not be zero.

Change-Id: I33fd3e49a1b3dcdc319309af736a9d785130af94
Releases: master, 9.5, 8.7
Resolves: #87954
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60884
Tested-by: TYPO3com <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Anja Leichsenring <>

History

#1 Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60299

#2 Updated by Gerrit Code Review 2 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60299

#3 Updated by Gerrit Code Review 20 days ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60883

#4 Updated by Gerrit Code Review 20 days ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60884

#5 Updated by Anonymous 20 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF