mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-28 02:20:18 -04:00
zstd-compressor: Abort on ZSTD_initCStream error
This doesn't seem to happen in practice, but the API says it's possible, so we better abort than run into weird states.
This commit is contained in:
1 parent
a68d120bc1
commit
c4d12fa6ad
1 file changed
+7
-1
@@ -104,8 +104,14 @@ flatpak_zstd_compressor_reset (GConverter *converter)
|
||||
{
|
||||
#ifdef HAVE_ZSTD
|
||||
FlatpakZstdCompressor *compressor = FLATPAK_ZSTD_COMPRESSOR (converter);
|
||||
size_t res;
|
||||
|
||||
ZSTD_initCStream(compressor->cstream, compressor->level);
|
||||
res = ZSTD_initCStream (compressor->cstream, compressor->level);
|
||||
if (ZSTD_isError (res))
|
||||
{
|
||||
g_error ("FlatpakZstdCompressor: failed to reset zstd stream: %s",
|
||||
ZSTD_getErrorName (res));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user