[poppler] Re: A crash and a easy but probably wrong fix

Albert Astals Cid aacid at kde.org
Thu Jan 5 06:49:45 PST 2006


A Dijous 05 Gener 2006 14:01, vàreu escriure:
> On Thursday 05 January 2006 00:42, Albert Astals Cid wrote:
> > My vote would be to simply apply this patch.
>
> The patch is wrong because its perfectly okay for offsets to be negative.
>
> From SplashBitmap::SplashBitmap():
> ..
>
>  if (!topDown) {
>     data += (height - 1) * rowSize;
>     rowSize = -rowSize;
>   }
>
> with other words, the pointer is adjusted to point near the end and rowSize
> is negative, so the offsets for positive x and y will become negative, and
> point to legitimate memory.

Right, but the fact is i've done a bit of research and the bitmap on Splash is 
put in its creator, the only class that creates Splash is SplashOutputDev 
that only creates topDown bitmaps = false when you pass it a param as false, 
but we are always calling SplashOutputDev with that parameter as true (well 
really we are not passing the param and it gets the true default valoue), so 
with our current code my fix is right ;-D

Options:
	a) remove the topDown possibility in SplashBitmap as no code uses it and keep 
my patch
	b) look for a better patch

Albert

	
	
		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y moviles desde 1 centimo por minuto. 
http://es.voice.yahoo.com


More information about the poppler mailing list