/* * Copyright (c) 2024 The WebM 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 in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
vpx_image_t img; // Set img_data and img_data_owner to junk values. vpx_img_wrap() should // not read these values on failure. unsignedchar empty[] = "";
img.img_data = empty;
img.img_data_owner = 1;
vpx_img_fmt_t format = VPX_IMG_FMT_I444; // 'align' must be a power of 2 but is not. This causes the vpx_img_wrap() // call to fail. The test verifies we do not read the junk values in 'img'. unsignedint align = 31;
EXPECT_EQ(vpx_img_wrap(&img, format, kWidth, kHeight, align, buf), nullptr);
}
vpx_image_t img;
vpx_img_fmt_t format = VPX_IMG_FMT_I444; unsignedint align = 32;
EXPECT_EQ(vpx_img_wrap(&img, format, kWidth, kHeight, align, buf), &img);
EXPECT_EQ(vpx_img_set_rect(&img, 0, 0, kWidth, kHeight), 0); // This would result in overflow because -1 is cast to UINT_MAX.
EXPECT_NE(vpx_img_set_rect(&img, static_cast<unsignedint>(-1), static_cast<unsignedint>(-1), kWidth, kHeight),
0);
}
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.