(rpng_encode.c) Use encoding_crc32
This commit is contained in:
parent
b7735520f2
commit
dbf6d9331f
|
@ -24,6 +24,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <encodings/crc32.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <file/archive_file.h>
|
||||
|
||||
|
@ -47,9 +48,7 @@ static void dword_write_be(uint8_t *buf, uint32_t val)
|
|||
static bool png_write_crc(RFILE *file, const uint8_t *data, size_t size)
|
||||
{
|
||||
uint8_t crc_raw[4] = {0};
|
||||
const struct file_archive_file_backend *stream_backend =
|
||||
file_archive_get_zlib_file_backend();
|
||||
uint32_t crc = stream_backend->stream_crc_calculate(0, data, size);
|
||||
uint32_t crc = encoding_crc32(0, data, size);
|
||||
|
||||
dword_write_be(crc_raw, crc);
|
||||
return filestream_write(file, crc_raw, sizeof(crc_raw)) == sizeof(crc_raw);
|
||||
|
|
Loading…
Reference in New Issue