mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
Coverity: fix WRaster convert uninitialized scalar variable
This commit is contained in:
committed by
Carlos R. Mafra
parent
6c7266c338
commit
94f98dcd25
@@ -778,6 +778,10 @@ static RXImage *image2GrayScale(RContext * ctx, RImage * image)
|
||||
RDestroyXImage(ctx, ximg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(gerr, 0, (image->width + 2) * sizeof(short));
|
||||
memset(ngerr, 0, (image->width + 2) * sizeof(short));
|
||||
|
||||
for (x = 0, y = 0; x < image->width; x++, y += channels) {
|
||||
gerr[x] = (ptr[y] * 30 + ptr[y + 1] * 59 + ptr[y + 2] * 11) / 100;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user