A tiled HEVC counts its entry points past a u8
Browse files at this commit907dae075e30f9fa5592287a448f65209e5e7b21Parent: a893c91- fix
- a tiled HEVC counts its entry points past a u8
1 changed file +9 -1
vendor/cros-codecs/src/codec/h265/parser.rsmodified+9 -1
| @@ -4112,7 +4112,15 @@ impl Parser { | |||
| 4112 | let max = if !pps.tiles_enabled_flag && pps.entropy_coding_sync_enabled_flag { | 4112 | let max = if !pps.tiles_enabled_flag && pps.entropy_coding_sync_enabled_flag { |
| 4113 | sps.pic_height_in_ctbs_y - 1 | 4113 | sps.pic_height_in_ctbs_y - 1 |
| 4114 | } else if pps.tiles_enabled_flag && !pps.entropy_coding_sync_enabled_flag { | 4114 | } else if pps.tiles_enabled_flag && !pps.entropy_coding_sync_enabled_flag { |
| 4115 | - u32::from((pps.num_tile_columns_minus1 + 1) * (pps.num_tile_rows_minus1 + 1) - 1) | 4115 | + // Widened first: the tile counts are `u8`, and §7.4.3.3.1 lets |
| 4116 | + // this parser accept 20 columns by 22 rows, whose product is | ||
| 4117 | + // 440 -- past a `u8` long before it is past the §7.4.7.1 bound. | ||
| 4118 | + // Multiplied narrow it wrapped to 183 in release (every entry | ||
| 4119 | + // point past the 184th refused on a conformant stream, which is | ||
| 4120 | + // this bug's own black picture again) and panicked in debug. | ||
| 4121 | + (u32::from(pps.num_tile_columns_minus1) + 1) | ||
| 4122 | + * (u32::from(pps.num_tile_rows_minus1) + 1) | ||
| 4123 | + - 1 | ||
| 4116 | } else { | 4124 | } else { |
| 4117 | (u32::from(pps.num_tile_columns_minus1) + 1) * sps.pic_height_in_ctbs_y - 1 | 4125 | (u32::from(pps.num_tile_columns_minus1) + 1) * sps.pic_height_in_ctbs_y - 1 |
| 4118 | }; | 4126 | }; |