1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed a crash when fetching large content in URL::FallbackDownloadTask

This commit is contained in:
Tom Poole 2019-06-28 12:52:36 +01:00
parent f9dad9d608
commit 5935040d78

View file

@ -62,8 +62,8 @@ struct FallbackDownloadTask : public URL::DownloadTask,
if (listener != nullptr)
listener->progress (this, downloaded, contentLength);
auto max = jmin ((int) bufferSize, contentLength < 0 ? std::numeric_limits<int>::max()
: static_cast<int> (contentLength - downloaded));
auto max = (int) jmin ((int64) bufferSize, contentLength < 0 ? std::numeric_limits<int64>::max()
: static_cast<int64> (contentLength - downloaded));
auto actual = stream->read (buffer.get(), max);