Re: libnsgif and memory bombs

2021-04-06 Thread jcupitt
That's great, thanks Michael. I'll remove my patch and update from your repo. On Mon, 5 Apr 2021 at 14:51, Michael Drake wrote: > > Hi John, > > Thanks for the patch. It is an improvement and I've applied it. > I'm currently considering moving the call to gif_initialise_sprite > into gif_decode_

Re: libnsgif and memory bombs

2021-04-03 Thread jcupitt
Here's a better version of the patch: https://github.com/libvips/libvips/blob/master/libvips/foreign/libnsgif/patches/delay-alloc.patch (removes a stray create_bitmap call) On Fri, 2 Apr 2021 at 11:58, wrote: > > Hi all, > > I had a thought regarding memory allocation in libnsgif. > > At the m

libnsgif and memory bombs

2021-04-03 Thread jcupitt
Hi all, I had a thought regarding memory allocation in libnsgif. At the moment, calling `gif_initialise()` will parse the GIF file and allocate memory for rendering. You then call gif_decode_frame() to decompress and render each frame of the animation. However, this means just opening the GIF ca

possible bug: libnsgif does not handle successive RESTORE frames correctly

2021-03-08 Thread jcupitt
Hello again everyone, I think I have a GIF which libnsgif does not handle correctly: https://github.com/libvips/libvips/blob/master/test/test-suite/images/dispose-previous.gif This GIF has three frames which draw three concentric red circles. The GIF does this: - clear frame frame 0: - dispos

Re: possible bug: libnsgif does not handle successive RESTORE frames correctly

2021-03-07 Thread jcupitt
Here's a possible patch: https://github.com/libvips/libvips/commit/bf522eeffc5aa84a275b1d53e24d0daace59fa3e On Sun, 7 Mar 2021 at 14:31, wrote: > > Hello again everyone, > > I think I have a GIF which libnsgif does not handle correctly: > > https://github.com/libvips/libvips/blob/master/test/te

Re: possible bug: libnsgif does not handle DISPOSE_PREVIOUS correctly

2020-07-06 Thread jcupitt
Thank you Michael! It now renders that test case correctly, and runs cleanly with valgrind. I had a couple of other small ideas for improvements to libnsgif, if changes are being made. I'd be happy to have a go at a patch if they sound useful. First, line 438 modifies the input buffer: http://so

Re: possible bug: libnsgif does not handle DISPOSE_PREVIOUS correctly

2020-07-04 Thread jcupitt
On Fri, 3 Jul 2020 at 12:16, wrote: > Thank you for libnsgif. I think I might have come across a gif that > fails to render correctly in libnsgif-0.2.1: > > https://user-images.githubusercontent.com/580843/8645-18bd1400-bd1c-11ea-923a-adeed2eba031.gif > > Frame 6 is DISPOSE_PREVIOUS and should

possible bug: libnsgif does not handle DISPOSE_PREVIOUS correctly

2020-07-03 Thread jcupitt
Hello all, Thank you for libnsgif. I think I might have come across a gif that fails to render correctly in libnsgif-0.2.1: https://user-images.githubusercontent.com/580843/8645-18bd1400-bd1c-11ea-923a-adeed2eba031.gif Frame 6 is DISPOSE_PREVIOUS and should unpaint the tips of the wings. lib