Avoid to write into smaller (in height) destination image

master
Stefan Jahn 3 years ago
parent e6566646c6
commit 839d5d7c6d

@ -13,7 +13,7 @@ void debayer_grbg16_simple (uint16_t * src, int src_w, int src_h,
uint8_t r, g, b;
int ys, yd, xs, xd;
for (ys = 0, yd = 0; ys < src_h; ys++) {
for (ys = 0, yd = 0; ys < src_h && yd < dst_h; ys++, yd++) {
for (xs = 0, xd = 0; xs < src_w; xs++) {
/* read the pixel but only the lower 8bit */
@ -50,7 +50,6 @@ void debayer_grbg16_simple (uint16_t * src, int src_w, int src_h,
/* if the source image is too small ignore the other places */
if (xd < dst_w)
dst += 3 * (dst_w - xd);
yd++;
}
}

Loading…
Cancel
Save