Skip to content

Commit

Permalink
fix(image): fix png operation memleak (openMVG#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentHuang authored Oct 28, 2022
1 parent 97fd1e2 commit fe8283c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/openMVG/image/image_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,9 @@ bool Read_PNG_ImageHeader(const char * filename, ImageHeader * imgheader)
bStatus = true;
}

png_destroy_info_struct(png_ptr, &info_ptr);
png_destroy_read_struct(&png_ptr, nullptr, nullptr);

fclose(file);
return bStatus;
}
Expand Down

0 comments on commit fe8283c

Please sign in to comment.