Hello Patrick,

On 11/01/2011 05:38 PM, Patrick Hartling wrote:
> On Nov 1, 2011, at 4:58 PM, Carsten Neumann wrote:
>> I'm not up to speed on the GIF spec or the loader, but your description
>> sounds absolutely reasonable to me.
>
> I cannot claim to be terribly knowledgeable about the GIF spec. We just 
> encountered these crashes, and it occurs to me now that we may have never had 
> customers using GIFs prior to this. As for this usage of animated GIFs, what 
> I can say is that the GIMP can load and save GIF images with varying frame 
> sizes, and every viewer I have tried renders the animations the way that I 
> would expect. To put it another way, I haven't read the GIF89a spec, but I 
> gather that this use case is valid--but possibly unusual.

oh, I didn't mean to say those were invalid images, just that I was 
surprised this case was allowed.

>>> Does this sound like a valid approach? I don't know if a patch would be
>>> helpful since we're using a version of OpenSG that is about 6 months out
>>> of date. I can submit one if it would help clarify what I have
>>> described. If nothing else, I have attached a GIF that demonstrates the
>>> crash in the GIF loader.
>>
>> I just ran a git blame on the GIF loader and with the exception of some
>> cosmetic changes the code was last touched in 2006 or before, so if you
>> have a patch it is likely to apply with no problems and I'd be very
>> happy to apply it. Thanks!
>
> I have attached the patch. I am not 100% certain that the pointer math that 
> accounts for the X offsets of each line in the image data is correct. The 
> images *look* correct when rendered by OpenSG. More importantly, valgrind 
> reports no invalid writes, and that ended up being my real benchmark. The use 
> of const pointers is incidental to accounting for the differing frame sizes. 
> I added that mainly to have the compiler help me narrow down potential places 
> where memory blocks were being modified.

It looks like a definite improvement to me. Thanks for the patch, committed.

        Cheers,
                Carsten

------------------------------------------------------------------------------
RSA® Conference 2012
Save $700 by Nov 18
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to