// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.
// Initializes the minimum bytes required to suppress MSAN warnings from // legitimate vector loads/stores on the right border, where some lanes are // uninitialized and assumed to be unused. void InitializePadding(PlaneBase& plane, const size_t sizeof_t) { #ifdefined(MEMORY_SANITIZER)
size_t xsize = plane.xsize();
size_t ysize = plane.ysize(); if (xsize == 0 || ysize == 0) return;
const size_t vec_size = MaxVectorSize(); if (vec_size == 0) return; // Scalar mode: no padding needed
Status PlaneBase::Allocate(JxlMemoryManager* memory_manager,
size_t pre_padding) {
JXL_ENSURE(bytes_.address<void>() == nullptr);
// Dimensions can be zero, e.g. for lazily-allocated images. Only allocate // if nonzero, because "zero" bytes still have padding/bookkeeping overhead. if (xsize_ == 0 || ysize_ == 0) { returntrue;
}
size_t max_y_size = std::numeric_limits<size_t>::max() / bytes_per_row_; if (ysize_ > max_y_size) { return JXL_FAILURE("Image dimensions are too large");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.