mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
No issue - Limit JPEG decoder memory allocation to surface cache size.
This means that for trivial images whose header specifies large dimensions but with no image data, we don't waste a lot of memory. See BZ bug 1277397
This commit is contained in:
parent
fae36a95ec
commit
cc6ef1f3b1
1 changed files with 4 additions and 0 deletions
|
|
@ -154,6 +154,10 @@ nsJPEGDecoder::InitInternal()
|
|||
mSourceMgr.skip_input_data = skip_input_data;
|
||||
mSourceMgr.resync_to_restart = jpeg_resync_to_restart;
|
||||
mSourceMgr.term_source = term_source;
|
||||
|
||||
// Limit the maximum allocation to the maximum our surface cache can hold.
|
||||
mInfo.mem->max_memory_to_use = static_cast<long>(
|
||||
std::min<size_t>(SurfaceCache::MaximumCapacity(), LONG_MAX));
|
||||
|
||||
// Record app markers for ICC data
|
||||
for (uint32_t m = 0; m < 16; m++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue