common: fix sycc420_to_rgb buffer overflow

This commit is contained in:
Mehdi Sabwat 2021-06-09 21:26:06 +02:00
parent 6a29f5a9e3
commit b239948ad9
1 changed files with 6 additions and 4 deletions

View File

@ -367,13 +367,15 @@ static void sycc420_to_rgb(opj_image_t *img)
++b; ++b;
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b); sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
if (*y != img->comps[0].data[max])
++y; ++y;
++r; ++r;
++g; ++g;
++b; ++b;
++cb; if (*cb != img->comps[1].data[max])
++cr; ++cb;
if (*cr != img->comps[2].data[max])
++cr;
} }
if (j < maxw) { if (j < maxw) {
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b); sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);