| 1 |
diff --git a/frmts/png/libpng/pngrutil.c b/frmts/png/libpng/pngrutil.c |
| 2 |
index 8e2b229720..789acbb80c 100644 |
| 3 |
--- a/frmts/png/libpng/pngrutil.c |
| 4 |
+++ b/frmts/png/libpng/pngrutil.c |
| 5 |
@@ -2087,10 +2087,8 @@ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) |
| 6 |
} |
| 7 |
} |
| 8 |
|
| 9 |
- if (png_crc_finish(png_ptr, 0) != 0) |
| 10 |
- return; |
| 11 |
- |
| 12 |
- png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf); |
| 13 |
+ if (png_crc_finish(png_ptr, 0) == 0) |
| 14 |
+ png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf); |
| 15 |
|
| 16 |
png_free(png_ptr, info_ptr->eXIf_buf); |
| 17 |
info_ptr->eXIf_buf = NULL; |