Skip to content

Commit

Permalink
Coverity: fix WRaster convert uninitialized scalar variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaciejak authored and crmafra committed Mar 3, 2023
1 parent d4ee17f commit 52a6237
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wrlib/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,10 @@ static RXImage *image2StandardPseudoColor(RContext * ctx, RImage * image)
RDestroyXImage(ctx, ximg);
return NULL;
}

memset(err, 0, 3 * (image->width + 2) * sizeof(short));
memset(nerr, 0, 3 * (image->width + 2) * sizeof(short));

for (x = 0, x1 = 0; x < image->width * 3; x1 += channels - 3) {
err[x++] = ptr[x1++];
err[x++] = ptr[x1++];
Expand Down

0 comments on commit 52a6237

Please sign in to comment.