summaryrefslogtreecommitdiff
path: root/src/format/image/png.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/image/png.c')
-rw-r--r--src/format/image/png.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/format/image/png.c b/src/format/image/png.c
index 1004b2a..8597a55 100644
--- a/src/format/image/png.c
+++ b/src/format/image/png.c
@@ -66,6 +66,12 @@ static ff_result ff_png_dispatch(ff_ctx* ctx, ff_stream* stream, ff_png_ctx *png
png_ctx->last_error = FF_RESULT_ERROR_READ_FILE_FAILURE;
return FF_RESULT_ERROR_READ_FILE_FAILURE;
}
+
+ uint32_t crc32 = ff_be32(crc);
+ if (tinf_crc32(chunk_data, length) != crc32) {
+ png_ctx->last_error = FF_RESULT_ERROR_INVALID_FILE;
+ return FF_RESULT_ERROR_INVALID_FILE;
+ }
}
}