- 2014.12.27 22:30 "[Tiff] [PATCH] tiff2pdf fixes for grayscale (min-is-white/black) and alpha", by Yuriy M. Kaminskiy
- 2014.12.29 22:29 "[Tiff] [PATCH] Signal error on unsupported sample/bit-depth in jbig codec instead of silently producing garbage", by Yuriy M. Kaminskiy
-
2014.12.30 20:41 "[Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Yuriy M. Kaminskiy
-
2014.12.30 20:55 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Jürgen_Buchmüller
- 2014.12.30 21:45 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Yuriy M. Kaminskiy
- 2014.12.31 14:33 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Olivier Paquet
- 2015.01.04 23:02 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Yuriy M. Kaminskiy
- 2014.12.31 09:36 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Jürgen_Buchmüller
-
2014.12.30 20:55 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Jürgen_Buchmüller
- 2015.01.25 16:56 "[Tiff] [security][PATCH] tiff2pdf: fix snprintf return value misuse", by Yuriy M. Kaminskiy
2014.12.31 09:36 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Jürgen_Buchmüller
Am Mittwoch, den 31.12.2014, 00:45 +0300 schrieb Yuriy M. Kaminskiy: > It's in CVS HEAD, commit that added it:
I see it now. It won't work right for negative numbers m1 and m2, and then tmsize_t may be either 32 or 64 bit signed, depending on the target environment being 32- or 64-bit. An adequate check could look like this
static tmsize_t
add_ms(tmsize_t m1, tmsize_t m2)
{
tmsize_t bytes = m1 + m2;
if (m1 > 0 && m2 > 0 && (uint64)bytes != (uint64)m1 +
(uint64)m2)
bytes = 0;
if (m1 < 0 && m2 < 0 && (uint64)-bytes != (uint64)-m1 +
(uint64)-m2)
bytes = 0;
return bytes;
}
I think using uint64 casts for the comparisons is sufficient, because tmsize_t is either int32 or int64. The negative numbers path will not be taken at all in reality, it's just there for completeness sake.
Jürgen