Commit 47c9b59 1 parent 7967a18 commit 47c9b59 Copy full SHA for 47c9b59
File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3010,7 +3010,9 @@ CPLErr VRTComplexSource::RasterIOProcessNoData(
3010
3010
// Cannot overflow since pData should at least have that number of
3011
3011
// elements
3012
3012
const size_t nPixelCount = static_cast <size_t >(nOutXSize) * nOutYSize;
3013
- if (nPixelCount > std::numeric_limits<size_t >::max () / sizeof (SourceDT))
3013
+ if (nPixelCount >
3014
+ static_cast <size_t >(std::numeric_limits<ptrdiff_t >::max ()) /
3015
+ sizeof (SourceDT))
3014
3016
{
3015
3017
CPLError (CE_Failure, CPLE_OutOfMemory,
3016
3018
" Too large temporary buffer" );
@@ -3226,8 +3228,9 @@ CPLErr VRTComplexSource::RasterIOInternal(
3226
3228
{
3227
3229
// Cannot overflow since pData should at least have that number of
3228
3230
// elements
3229
- if (nPixelCount > std::numeric_limits<size_t >::max () /
3230
- static_cast <size_t >(nWordSize))
3231
+ if (nPixelCount >
3232
+ static_cast <size_t >(std::numeric_limits<ptrdiff_t >::max ()) /
3233
+ static_cast <size_t >(nWordSize))
3231
3234
{
3232
3235
CPLError (CE_Failure, CPLE_OutOfMemory,
3233
3236
" Too large temporary buffer" );
You can’t perform that action at this time.
0 commit comments