[FFmpeg-devel] [PATCH 4/7] avformat/vvc: Fix crash on allocation failure, avoid allocations

Nuo Mi nuomi2021 at gmail.com
Thu Jun 6 16:11:40 EEST 2024


On Wed, Jun 5, 2024 at 7:53 PM Andreas Rheinhardt <
andreas.rheinhardt at outlook.com> wrote:

> Andreas Rheinhardt:
> > This is the VVC version of 8b5d15530127fea54e934043a64653859de07353.
> >
> > (Hint: This ensures that the order of NALU arrays is OPI-VPS-SPS-PPS-
> > Prefix-SEI-Suffix-SEI, regardless of the order in the original
> > extradata. I hope this is right.)
> >
> > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> > ---
> >  libavformat/vvc.c | 169 ++++++++++++++++++++--------------------------
> >  1 file changed, 73 insertions(+), 96 deletions(-)
> >
>
> Even after these patches, there are some strange things going in vvc.c:
> 1. There are at least 71 bits in general_constraint_info (if present),
> yet only 70 of these are written (the
> gci_no_chroma_qp_offset_constraint_flag is not).
>
Not sure why this happened, but 14496-15 said  this
see the comment:
        /*
         * unsigned int (1) ptl_frame_only_constraint_flag
         * unsigned int (1) ptl_multilayer_enabled_flag
         * unsigned int (8*num_bytes_constraint_info -2)
general_constraint_info */
 8*9-2 = 70.
vvcc_parse_ptl parses the information from vps or sps.
vvcc_write writes VvcDecoderConfigurationRecord, it's not a bit-to-bit map.
I guess.

2. The code contains checks for VVC_DCI_NUT, yet these are dead, because
> these NALU type is filtered out before.
>
it's from the spec, see "if (NAL_unit_type != DCI_NUT  &&  NAL_unit_type !=
OPI_NUT)" in  https://cloud.tencent.com/developer/article/2227294
num_nalus is inferred as 1 if it does not exist. Maybe we can add a check

3. A comment claims to need at least one VPS and SPS, but it actually
> checks for SPS and PPS. Does someone know what was intended?
>
it's a typo. VPS is optional, SPS and PPS are mandatory.

>
> - Andreas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list