From 5dcad27410fab6f295d2eb8650e31e7c2a40c764 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 25 Jul 2024 22:41:11 -0700 Subject: [PATCH] fix: gcc segfault --- flaca/src/image/jpegtran.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flaca/src/image/jpegtran.rs b/flaca/src/image/jpegtran.rs index ee7f7ab..6be7adc 100644 --- a/flaca/src/image/jpegtran.rs +++ b/flaca/src/image/jpegtran.rs @@ -255,6 +255,7 @@ impl<'a> From<&'a [u8]> for JpegSrcInfo<'a> { // Set up the error, then the struct. out.cinfo.common.err = std::ptr::addr_of_mut!(*out.err); jpeg_create_decompress(&mut out.cinfo); + out.cinfo.common.progress = std::ptr::null_mut(); } out @@ -296,6 +297,7 @@ impl From<&mut JpegSrcInfo<'_>> for JpegDstInfo { // Set up the error, then the struct. out.cinfo.common.err = std::ptr::addr_of_mut!(*out.err); jpeg_create_compress(&mut out.cinfo); + out.cinfo.common.progress = std::ptr::null_mut(); // Sync the source trace level with the destination. src.err.trace_level = (*out.err).trace_level;