You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

  1. From 468988860e0dae62ebbf991627c74bcbb4bd256f Mon Sep 17 00:00:00 2001
  2. From: erouault <erouault>
  3. Date: Mon, 29 May 2017 11:29:06 +0000
  4. Subject: [PATCH] * libtiff/tif_getimage.c: initYCbCrConversion(): stricter
  5. validation for refBlackWhite coefficients values. To avoid invalid
  6. float->int32 conversion (when refBlackWhite[0] == 2147483648.f) Fixes
  7. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1907 Credit to OSS Fuzz
  8. ---
  9. ChangeLog | 8 ++++++++
  10. libtiff/tif_getimage.c | 2 +-
  11. 2 files changed, 9 insertions(+), 1 deletion(-)
  12. diff --git a/ChangeLog b/ChangeLog
  13. index a2ddaac2..04881ba7 100644
  14. --- a/ChangeLog
  15. +++ b/ChangeLog
  16. @@ -1,5 +1,13 @@
  17. 2017-05-29 Even Rouault <even.rouault at spatialys.com>
  18. + * libtiff/tif_getimage.c: initYCbCrConversion(): stricter validation for
  19. + refBlackWhite coefficients values. To avoid invalid float->int32 conversion
  20. + (when refBlackWhite[0] == 2147483648.f)
  21. + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1907
  22. + Credit to OSS Fuzz
  23. +
  24. +2017-05-29 Even Rouault <even.rouault at spatialys.com>
  25. +
  26. * libtiff/tif_color.c: TIFFYCbCrToRGBInit(): stricter clamping to avoid
  27. int32 overflow in TIFFYCbCrtoRGB().
  28. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1844
  29. diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
  30. index dc373abc..a209a7a7 100644
  31. --- a/libtiff/tif_getimage.c
  32. +++ b/libtiff/tif_getimage.c
  33. @@ -2241,7 +2241,7 @@ DECLARESepPutFunc(putseparate8bitYCbCr11tile)
  34. static int isInRefBlackWhiteRange(float f)
  35. {
  36. - return f >= (float)(-0x7FFFFFFF + 128) && f <= (float)0x7FFFFFFF;
  37. + return f > (float)(-0x7FFFFFFF + 128) && f < (float)0x7FFFFFFF;
  38. }
  39. static int