avfilter/vf_thumbnail: fix buffer overflow for odd sized HBD inputs

This histogram index was not correctly downshifted to 8-bit.
This commit is contained in:
Niklas Haas 2025-08-06 12:11:59 +02:00 committed by Niklas Haas
parent 09cb2d41d1
commit ac59fc542f

View file

@ -189,7 +189,7 @@ static void get_hist16(int *hist, const uint8_t *p, ptrdiff_t stride,
}
/* handle tail */
for (int x = width4; x < width; x++)
hist[p16[x]]++;
hist[(uint8_t) (p16[x] >> shift)]++;
p += stride;
}