Skip to content

Commit

Permalink
memory-layout/memory-operations: Fix swapRows call in pixels solution
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 authored and teodutu committed Apr 3, 2024
1 parent 7837801 commit 58c7f32
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 reverse_pic(struct picture *pic)
{
for (int i = 0; i < pic->height / 2; ++i)
swap_rows(pic->pix_array[i], pic->pix_array[pic->height - 1 - i],
pic->height);
pic->width);
}

int main(void)
Expand Down

0 comments on commit 58c7f32

Please sign in to comment.