From 26dd80eeb35ab98a0617981d35bbce252d0386b1 Mon Sep 17 00:00:00 2001 From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org> Date: Mon, 19 Jan 1998 17:13:38 +0100 Subject: [PATCH] buf fix Rev: src/modules/_Image_JPEG/image_jpeg.c:1.4 --- src/modules/_Image_JPEG/image_jpeg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/_Image_JPEG/image_jpeg.c b/src/modules/_Image_JPEG/image_jpeg.c index 118b854abe..bb6d5e19ef 100644 --- a/src/modules/_Image_JPEG/image_jpeg.c +++ b/src/modules/_Image_JPEG/image_jpeg.c @@ -97,14 +97,14 @@ boolean my_empty_output_buffer(struct jpeg_compress_struct *cinfo) int pos; char *new; - pos=dm->len-dm->pub.free_in_buffer; - new=realloc(dm->buf,dm->len+BUF_INCREMENT); + pos=dm->len; /* foo! dm->len-dm->pub.free_in_buffer; */ + new=(char*)realloc(dm->buf,dm->len+BUF_INCREMENT); if (!new) return FALSE; dm->buf=new; - dm->pub.free_in_buffer+=BUF_INCREMENT; dm->len+=BUF_INCREMENT; - dm->pub.next_output_byte=new+pos; + dm->pub.free_in_buffer=dm->len-pos; + dm->pub.next_output_byte=(JOCTET*)new+pos; return TRUE; } -- GitLab