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;
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
++y;
if (*y != img->comps[0].data[max])
++y;
++r;
++g;
++b;
++cb;
++cr;
if (*cb != img->comps[1].data[max])
++cb;
if (*cr != img->comps[2].data[max])
++cr;
}
if (j < maxw) {
sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);