🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #2294

Re: popi patchlevel 3

#2294
From: Mathew Yeates
Date: Fri, 29 Dec 1989 18:53
28 lines
1396 bytes
In article <2347@pear.ecs.clarkson.edu> nelson@sun.soe.clarkson.edu writes:
>The routine ImgAlloc found in io.c seems to have a bug.  First it mallocs
>an array of pointers, then fills that array in with more malloced pointers.
>Now, since the array is accessed using the y coordinate, you would think
>that the size of the array would be related to Ysize.  Instead, a reference
>is made to Xsize (See below).  This seems wrong to me.
>-russ
>
>
>pixel_t **
>ImgAlloc()
>{
>    pixel_t		**img,
>    			**linep,
>			**imgend;
>
>    noerr = TRUE;
>    if ((img = (pixel_t **) LINT_CAST(Emalloc((unsigned)Xsize * sizeof(pixel_t *)))) == 0)
>	return (pixel_t **) 0;
>
>    imgend = &img[Ysize];
>    for (linep = img; linep != imgend; ++linep)
>	*linep = (pixel_t *) Emalloc((unsigned)Xsize * sizeof (pixel_t));

yes this is incorrect. The first should be Y, the second X.

-mathew
mathew@jane.jpl.nasa.gov 
Technical Details
Message-ID: <1989Dec29.185331.2549@elroy.jpl.nasa.gov>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!news
References: <2347@pear.ecs.clarkson.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!news
From: mathew@jane.Jpl.Nasa.Gov (Mathew Yeates)
Newsgroups: comp.sources.bugs
Subject: Re: popi patchlevel 3
Message-ID: <1989Dec29.185331.2549@elroy.jpl.nasa.gov>
Date: 29 Dec 89 18:53:31 GMT
References: <2347@pear.ecs.clarkson.edu>
Reply-To: mathew@jane.Jpl.Nasa.Gov (Mathew Yeates)
Organization: Image Analysis Systems Grp, JPL
Lines: 28