Skip to content

Commit 3676195

Browse files
committed
fix: correct unique_ptr buffer access in media_io
1 parent 396dd1f commit 3676195

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

examples/common/media_io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ uint8_t* decode_webp_image_to_buffer(const uint8_t* data,
231231
const int decoded_channels = features.has_alpha ? 4 : 3;
232232
for (size_t i = 0; i < pixel_count; ++i) {
233233
const uint8_t* src = decoded.get() + i * decoded_channels;
234-
grayscale[i] = static_cast<uint8_t>((77 * src[0] + 150 * src[1] + 29 * src[2] + 128) >> 8);
234+
grayscale.get()[i] = static_cast<uint8_t>((77 * src[0] + 150 * src[1] + 29 * src[2] + 128) >> 8);
235235
}
236236

237237
return grayscale.release();

0 commit comments

Comments
 (0)