This source file includes following definitions.
- VerifyCanvasSize
#include "ui/surface/transport_dib.h"
#include "skia/ext/platform_canvas.h"
bool TransportDIB::VerifyCanvasSize(int w, int h) {
static const size_t kMaxSize = static_cast<size_t>(INT_MAX);
const size_t one_stride = skia::PlatformCanvasStrideForWidth(1);
const size_t stride = skia::PlatformCanvasStrideForWidth(w);
if (w <= 0 || h <= 0 || static_cast<size_t>(w) > (kMaxSize / one_stride) ||
static_cast<size_t>(h) > (kMaxSize / stride)) {
return false;
}
return (stride * h) <= size_;
}