Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Camlimages integer overflows with PNG images
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-07-03 (17:37)
From: Anil Madhavapeddy <anil@r...>
Subject: Re: [Caml-list] Camlimages integer overflows with PNG images
On 3 Jul 2009, at 18:28, Richard Jones wrote:

> On Fri, Jul 03, 2009 at 06:19:49PM +0100, Anil Madhavapeddy wrote:
>> Do you have a patch for this at all?  I need to stick it into OpenBSD
>> fairly urgently as we're in release lock.
> Yes, I worked up a patch here:
> Not entirely sure if it is correct and complete though, so if you have
> any suggested changes, please share them.

Should width and height be clamped further to 31-/63- bits in addition  
to the multiplication check?  It's stored in an OCaml int later on,  
and it's pretty unlikely anyone would be working with images that size.