Skip to content

Commit

Permalink
Fix pixels reverse solution to use width for swapRows
Browse files Browse the repository at this point in the history
The proposed solution for reversePic erroneously passes the height of the
image to the ancillary function that swaps rows. Updated to use width
instead.

Signed-off-by: Cosmin Popa <[email protected]>
  • Loading branch information
c7stef committed Mar 12, 2024
1 parent c668bef commit 7ec7ec4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void reversePic(Picture *pic)
{
for (int i = 0; i < pic->height / 2; ++i)
swapRows(pic->pix_array[i], pic->pix_array[pic->height - 1 - i],
pic->height);
pic->width);
}

int main(void)
Expand Down

0 comments on commit 7ec7ec4

Please sign in to comment.