Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6e5cd7

Browse files
committed
Fix out of bounds in log_tile_cols_from_picsize_level
This accidentally used enum values as array indices, and as such would run from 10 to 255 on a 14 element array. Bug: b/465388500 Change-Id: Ibaa1f3444934fdf574ad908d57aee9590b21b089
1 parent b98c796 commit d6e5cd7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

vp9/encoder/vp9_encoder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ static INLINE int log_tile_cols_from_picsize_level(uint32_t width,
11951195
int i;
11961196
const uint32_t pic_size = width * height;
11971197
const uint32_t pic_breadth = VPXMAX(width, height);
1198-
for (i = LEVEL_1; i < LEVEL_MAX; ++i) {
1198+
for (i = 0; i < VP9_LEVELS; ++i) {
11991199
if (vp9_level_defs[i].max_luma_picture_size >= pic_size &&
12001200
vp9_level_defs[i].max_luma_picture_breadth >= pic_breadth) {
12011201
return get_msb(vp9_level_defs[i].max_col_tiles);

0 commit comments

Comments
 (0)