ff_vvc_palette_escape_val() can return AVERROR in which case the coeff*scale will overflow.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -2054,9 +2054,9 @@ static int palette_subblock_data(VVCLocalContext *lc, · 2053 unmodified lines | ||
| 2054 | 2054 | const int v = PALETTE_INDEX(xc, yc); |
| 2055 | 2055 | if (v == esc) { |
| 2056 | 2056 | const int coeff = ff_vvc_palette_escape_val(lc, (1 << sps->bit_depth) - 1); |
| 2057 | − const int pixel = av_clip_intp2(RSHIFT(coeff * scale, 6), sps->bit_depth); | |
| 2058 | 2057 | if (coeff < 0) |
| 2059 | 2058 | return AVERROR_INVALIDDATA; |
| 2059 | + const int pixel = av_clip_intp2(RSHIFT(coeff * scale, 6), sps->bit_depth); | |
| 2060 | 2060 | PALETTE_SET_PIXEL(xc, yc, pixel); |
| 2061 | 2061 | } else { |
| 2062 | 2062 | PALETTE_SET_PIXEL(xc, yc, plt->entries[v]); |