avcodec/vvcdec: return error if CTU size > 128

The v3 spec reserves CTU size 256. Currently, we use an uint8_t* table to hold cb_width and cb_height.
If a CTU size of 256 is not split, cb_width and cb_height will overflow to 0.
To avoid switching to uint16_t, rejecting CTU size 256 provides a simple solution.
pull/391/head
Nuo Mi 2 months ago
parent eb67e60cb0
commit 4de67e8746
  1. 6
      libavcodec/vvc/ps.c

@ -649,6 +649,12 @@ static int decode_ps(VVCParamSets *ps, const CodedBitstreamH266Context *h266, vo
if (ret < 0)
return ret;
if (rsps->sps_log2_ctu_size_minus5 > 2) {
// CTU > 128 are reserved in vvc spec v3
av_log(log_ctx, AV_LOG_ERROR, "CTU size > 128. \n");
return AVERROR_PATCHWELCOME;
}
ret = decode_pps(ps, rpps);
if (ret < 0)
return ret;

Loading…
Cancel
Save