diff options
author | Frank Plowman <post@frankplowman.com> | 2025-01-10 21:29:07 +0000 |
---|---|---|
committer | Nuo Mi <nuomi2021@gmail.com> | 2025-01-12 13:15:06 +0800 |
commit | 8bd66a8c9587af61c7b46558be3c4ee317c1af5a (patch) | |
tree | 8e1d497780015e8b81ebdde26dfceb5feb1920d8 /libswscale/utils.c | |
parent | 2202dcfc0fbee51e0fe280877fedf07e6762f3a4 (diff) | |
download | ffmpeg-8bd66a8c9587af61c7b46558be3c4ee317c1af5a.tar.gz |
lavc/vvc: Check slice structure
The criteria for slice structure validity is similar to that of
subpicture structure validity that we saw not too long ago [1].
The relationship between tiles and slices must satisfy the following
properties:
* Exhaustivity. All tiles in a picture must belong to a slice. The
tiles cover the picture, so this implies the slices must cover the
picture.
* Mutual exclusivity. No tile may belong to more than one slice, i.e.
slices may not overlap.
In most cases these properties are guaranteed by the syntax. There is
one noticable exception however: when pps_tile_idx_delta_present_flag is
equal to one, each slice is associated with a syntax element
pps_tile_idx_delta_val[i] which "specifies the difference between the
tile index of the tile containing the first CTU in the ( i + 1 )-th
rectangular slice and the tile index of the tile containing the first
CTU in the i-th rectangular slice" [2]. When these syntax elements are
present, the i-th slice can begin anywhere and the usual guarantees
provided by the syntax are lost.
The patch detects slice structures which violate either of the two
properties above, and are therefore invalid, while building the
slice map. Should the slice map be determined to be invalid, an
AVERROR_INVALIDDATA is returned. This prevents issues including
segmentation faults when trying to decode, invalid bitstreams.
[1]: https://ffmpeg.org//pipermail/ffmpeg-devel/2024-October/334470.html
[2]: H.266 (V3) Section 7.4.3.5, Picture parameter set RBSP semantics
Signed-off-by: Frank Plowman <post@frankplowman.com>
Diffstat (limited to 'libswscale/utils.c')
0 files changed, 0 insertions, 0 deletions