Contents of /trunk/ghostscript-gpl/patches/ghostscript-gpl-8.71-jbig2-image-refcount.patch.patch
Parent Directory | Revision Log
Revision 1374 -
(show annotations)
(download)
Wed Jun 29 12:17:32 2011 UTC (13 years, 3 months ago) by niro
File size: 917 byte(s)
Wed Jun 29 12:17:32 2011 UTC (13 years, 3 months ago) by niro
File size: 917 byte(s)
added fedora patches
1 | diff -up ghostscript-8.71/jbig2dec/jbig2_image.c.jbig2-image-refcount ghostscript-8.71/jbig2dec/jbig2_image.c |
2 | --- ghostscript-8.71/jbig2dec/jbig2_image.c.jbig2-image-refcount 2010-08-05 14:55:56.417043303 +0100 |
3 | +++ ghostscript-8.71/jbig2dec/jbig2_image.c 2010-08-05 14:56:46.796169065 +0100 |
4 | @@ -60,15 +60,18 @@ Jbig2Image* jbig2_image_new(Jbig2Ctx *ct |
5 | /* clone an image pointer by bumping its reference count */ |
6 | Jbig2Image* jbig2_image_clone(Jbig2Ctx *ctx, Jbig2Image *image) |
7 | { |
8 | - image->refcount++; |
9 | + if (image) |
10 | + image->refcount++; |
11 | return image; |
12 | } |
13 | |
14 | /* release an image pointer, freeing it it appropriate */ |
15 | void jbig2_image_release(Jbig2Ctx *ctx, Jbig2Image *image) |
16 | { |
17 | - image->refcount--; |
18 | - if (!image->refcount) jbig2_image_free(ctx, image); |
19 | + if (image) { |
20 | + image->refcount--; |
21 | + if (!image->refcount) jbig2_image_free(ctx, image); |
22 | + } |
23 | } |
24 | |
25 | /* free a Jbig2Image structure and its associated memory */ |