summaryrefslogtreecommitdiff
path: root/src/jpeg.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2014-06-21 15:52:43 -0400
committerJorge Arellano Cid <jcid@dillo.org>2014-06-21 15:52:43 -0400
commita53102d108d53fec583d73f3d4349b78a48a714d (patch)
treec7e4799466793b8e4f9525a15d6c8da6556fb926 /src/jpeg.c
parent2cc782748bbe4f84d248decf7e85bcfce31b0cdd (diff)
Ensure png, jpeg and gif decoders don't use DilloImage after set_parms()
This allows reuse of the dicache entry after repush changes DilloImage.
Diffstat (limited to 'src/jpeg.c')
-rw-r--r--src/jpeg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/jpeg.c b/src/jpeg.c
index 625808fb..5652aa56 100644
--- a/src/jpeg.c
+++ b/src/jpeg.c
@@ -304,6 +304,7 @@ static void Jpeg_write(DilloJpeg *jpeg, void *Buf, uint_t BufSize)
(uint_t)jpeg->cinfo.image_width,
(uint_t)jpeg->cinfo.image_height,
type, 1 / 2.2);
+ jpeg->Image = NULL; /* safeguard: may be freed by its owner later */
/* decompression step 4 (see libjpeg.doc) */
jpeg->state = DILLO_JPEG_STARTING;