| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Which relies on undefined behaviour. Instead of checking for an
overflowed integer after the fact, check whether the addition would
be possible at all.
Fixes: CVE-2017-6312
https://bugzilla.gnome.org/show_bug.cgi?id=779012
|
|
|
|
|
|
|
|
|
|
|
| |
The code is correct (the line buffer is set when DecodeHeader() returns
successfully with a non-zero-length line), but that’s not at all obvious
from the code, and is tripping Coverity up. Add an assertion to make it
clearer.
Coverity ID: 1400057
https://bugzilla.gnome.org/show_bug.cgi?id=778943
|
|
|
|
|
|
|
|
| |
If we don't even read enough data to fill the header, return an
error. This doesn't cover everything that could go wrong with
the ICO incremental loader, but this is a good first throw.
https://bugzilla.gnome.org/show_bug.cgi?id=778204
|
|
|
|
|
|
|
| |
Despite the inherited comment, commit 99508c7 sorted the icons by
increasing instead of decreasing quality.
https://bugzilla.gnome.org/show_bug.cgi?id=785447
|
|
|
|
|
|
|
| |
If an icon entry is broken, skip over it, but report the breakage if we
could not find a single valid entry.
https://bugzilla.gnome.org/show_bug.cgi?id=776040
|
|
|
|
|
|
| |
In case the offset is MAXINT, don't try to get a header size past it.
https://bugzilla.gnome.org/show_bug.cgi?id=776040
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure that the calculations we're doing on unsigned bytes can fit in
the target variable by making it a 32-bit unsigned int.
As detected by UBSan:
io-ico.c:288:26: runtime error: left shift of 146 by 24 places cannot be
represented in type 'int'
io-ico.c:287:38: runtime error: left shift of 222 by 24 places cannot be
represented in type 'int'
https://bugzilla.gnome.org/show_bug.cgi?id=776040
|
|
|
|
|
|
|
|
|
|
|
| |
Seeing as this is only a comparison, don't try to do arithmetics that
could overflow.
Detected by UBSan:
io-ico.c:204:9: runtime error: signed integer overflow: 2134193699 -
-555819298 cannot be represented in type 'int'
https://bugzilla.gnome.org/show_bug.cgi?id=776040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sscanf() and strtol() are both locale-dependent. In addition, the return
value of sscanf() was not being checked (so it could fail without being
noticed), and there was no bounds checking being performed.
Bounds checking is now performed, although the bounds have been chosen
for conservative backwards-compatibility, and may not be the most
appropriate.
Coverity CID: 1388522
https://bugzilla.gnome.org/show_bug.cgi?id=776990
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At a first read through, it looks like the call to OneLine() could end
up dereferencing context->pixbuf when it’s NULL. However, due to a
combination of other checks in the caller, OneLine() will only be called
after DecodeHeader() has set context->pixbuf to a valid object.
Otherwise, if DecodeHeader() bails with an error, the pixbuf will never
be dereferenced.
Add a comment trying to explain this, and an assertion which backs it up
more rigorously.
Coverity ID: 1388531
https://bugzilla.gnome.org/show_bug.cgi?id=777374
|
| |
|
|
|
|
|
|
|
| |
When the icon is constructed bottom to top, the y coordinates were
incorrectly computed.
https://bugzilla.gnome.org/show_bug.cgi?id=581484
|
|
|
|
|
|
|
|
|
|
| |
As we always create a GdkPixbuf with alpha, even if the original file
doesn't have an alpha channel, or a mask, make sure to set the alpha
pixel value in all cases, if only to have it overridden if there is a
mask present.
This makes it possible to use the reference test without having
differing alpha values.
|
|
|
|
| |
And use INFOHEADER_SIZE instead.
|
|
|
|
| |
Not the largest data size.
|
| |
|
| |
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=770756
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is some redundancy between the ico directory and the
bitmap image header. If the two disagree on the icon dimensions,
just toss the image, instead of risking crashes or OOM later. Also
add some more debug spew that helped in tracking this down, and
make error messages more unique.
The commit also includes a test image that has an example of
this discrepancy and triggers the early exit.
https://bugzilla.gnome.org/show_bug.cgi?id=769170
|
|
|
|
|
|
|
| |
Follow-up to previous commit; implement the new API in the modules we
ship that can save pixbufs.
https://bugzilla.gnome.org/show_bug.cgi?id=683371
|
|
|
|
|
|
|
|
|
|
| |
When the ico header turn out to be bad, always set an
error when we fail. Otherwise, applications will get
confused.
This commit also adds an example image with a bad ico header.
https://bugzilla.gnome.org/show_bug.cgi?id=768484
|
|
|
|
| |
In particular, add the canonical image/vnd.microsoft.icon
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In both loading and saving them. The ico format uses "0" as the width
or height to mean 256:
https://en.wikipedia.org/wiki/ICO_%28file_format%29#Icon_resource_structure
Also add a test for that.
https://bugzilla.gnome.org/show_bug.cgi?id=674724
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=641106
|
| |
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=144042
|
|
|
|
|
|
|
|
|
|
| |
* Previously we were selecting the largest icon image and then
failing if it was compressed or it was somehow different than
we expected.
* Instead we should go back to the next largest and so on and see
if there's one we can read.
https://bugzilla.gnome.org/show_bug.cgi?id=652498
|
|
|
|
| |
This is copying similar changes from glib.
|
|
|
|
|
|
|
|
| |
If we're building a loader like png into gdk-pixbuf, we need to
include the alias header. Otherwise we get internal PLT entries,
which makes make check fail.
https://bugzilla.gnome.org/show_bug.cgi?id=623314
|
| |
|
|
|
|
|
| |
We came up short when the image width is not a multiple of 8.
Bug 585383, fix by Felix Riemann.
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-06-21 Johan Dahlin <jdahlin@async.com.br>
* *.[ch]: Include "config.h" instead of <config.h>
Command used:
find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
Rubberstamped by Mitch and Tim
svn path=/trunk/; revision=20669
|
|
|
|
| |
svn path=/trunk/; revision=20463
|
|
|
|
| |
svn path=/trunk/; revision=20451
|
|
|
|
| |
svn path=/trunk/; revision=20367
|
|
|
|
| |
svn path=/trunk/; revision=20259
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-05-27 Tor Lillqvist <tml@novell.com>
* io-*.c: Use explicit G_MODULE_EXPORT decoration when building
the loader in question as a module.
* gdk-pixbuf-io.c: Enable included build of the icns and jasper
loaders.
svn path=/trunk/; revision=20192
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2007-03-09 Matthias Clasen <mclasen@redhat.com>
* Everywhere: Remove unnecessary NULL checks before
g_free(). (#369666, Morten Welinder, Djihed Afifi)
* configure.in: Check for ftw.h
svn path=/trunk/; revision=17444
|
|
|
|
|
|
|
|
|
| |
2007-02-27 Felix Riemann <friemann@svn.gnome.org>
* io-ico.c: (fill_info): Add image/x-ico to supported mime types.
Fixes bug #393599.
svn path=/trunk/; revision=17361
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2006-10-11 Tor Lillqvist <tml@novell.com>
* configure.in: Enable having some gdk-pixbuf loaders built-in
even if loading the others dynamically. Define Automake
conditional INCLUDE_FOO for each loader as TRUE if that loader is
built-in. See also gdk-pixbuf/ChangeLog.
2006-10-11 Tor Lillqvist <tml@novell.com>
Enable having some loaders built-in even if loading the others
dynamically. Have loaders in the same order as in configure.in in
all places where they are handled/listed.
* Makefile.am: Define the STATIC_FOO_LIB and FOO_LIB macros
conditionally depending on whether said loader is built-in or
not. Use the names libstatic-pixbufloader-foo.la instead of
libpixbufloader-static-foo.la for the built-in ones so that the
"echo libpixbufloader-*.la" won't match them.
* gdk-pixbuf-io.c: Reorganize code as to plumb the built-in
loaders also if USE_GMODULE. Don't warn about a missing
gdk-pixbuf.loaders file if we have at least one included loader.
* gdk-pixbuf-private.h
* io-*.c: Don't define a generic MODULE_ENTRY, as we can't use it
in the loaders anyway. Each loader needs to check if INCLUDE_foo
is defined.
|
|
|
|
|
|
|
| |
2005-08-18 Matthias Clasen <mclasen@redhat.com>
* io-ico.c (DecodeHeader): Check for overflow in one more
place. (#313818, Tommi Komulainen)
|
|
|
|
|
|
| |
2005-02-23 Matthias Clasen <mclasen@redhat.com>
* io-ico.c: Fix a typo. (#168173, Ivan Wong)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2004-11-12 Matthias Clasen <mclasen@redhat.com>
Changes to make gdk-pixbuf threadsafe (#157310, #157306,
Colin Walters):
* gdk-pixbuf-io.h (enum GdkPixbufFormatFlags): Add
GDK_PIXBUF_FORMAT_THREADSAFE to indicate that an image loader
is threadsafe.
* gdk-pixbuf-io.c (get_file_formats, _gdk_pixbuf_load_module):
Use a lock to make initialization of global data structures
threadsafe.
* gdk-pixbuf-private.h:
* gdk-pixbuf-io.c (_gdk_pixbuf_lock, _gdk_pixbuf_unlock):
Auxiliary functions which use another lock to protect
threadunsafe image loaders.
* gdk-pixbuf-io.c (gdk_pixbuf_real_save):
(save_to_callback_with_tmp_file):
(gdk_pixbuf_real_save_to_callback):
(gdk_pixbuf_new_from_xpm_data):
(_gdk_pixbuf_generic_image_load):
* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file):
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module):
(gdk_pixbuf_loader_close):
(gdk_pixbuf_loader_finalize):
Use _gdk_pixbuf_lock() and _gdk_pixbuf_unlock().
* io-ani.c, io-bmp.c, io-gif.c, io-ico.c:
* io-jpeg.c, io-pcx.c, io-png.c, io-pnm.c:
* io-ras.c, io-tga.c, io-wbmp.c, io-xbm.c:
* io-xpm.c: Mark as threadsafe.
* io-tiff.c: Remove pointless locking, mark as
threadunsafe.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Wed Jul 7 23:53:58 2004 Matthias Clasen <maclas@gmx.de>
* gdk-pixbuf-io.h:
* gdk-pixbuf-io.c (gdk_pixbuf_format_is_disabled):
* gdk-pixbuf-io.c (gdk_pixbuf_format_set_disabled):
* gdk-pixbuf-io.c (gdk_pixbuf_format_get_license):
New functions to disable/enable individual loaders and to
obtain license information about loaders.
* gdk-pixbuf-io.h (GdkPixbufFormat): Add disabled and
license fields.
* gdk-pixbuf-io.c (_gdk_pixbuf_get_module):
* gdk-pixbuf-io.c (_gdk_pixbuf_get_named_module): Skip
disabled loaders.
* io-*.c: Add license information in the fill_info
functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Wed Jan 7 01:17:36 2004 Matthias Clasen <maclas@gmx.de>
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_size_func):
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_set_size):
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_init): Make it possible
to call gdk_pixbuf_loader_set_size (loader, 0, 0) by changing
the initial values of priv->width/height to -1.
* io-tiff.c (tiff_image_parse):
* io-ras.c (RAS2State):
* io-pnm.c (gdk_pixbuf__pnm_image_load_increment):
* io-pcx.c (gdk_pixbuf__pcx_load_increment):
* io-jpeg.c (gdk_pixbuf__jpeg_image_load_increment):
* io-png.c (png_info_callback):
* io-ico.c (DecodeHeader):
* io-bmp.c (DecodeHeader): Call size_func once the size is known,
even if the module can't make use of the scaling information. If
size_func returns 0, don't allocate a pixbuf and return, if
necessary with an error.
* gdk-pixbuf.h:
* gdk-pixbuf-io.c (gdk_pixbuf_get_file_info): A new function
to determine the type and size of an image file without loading
it completely. (#53725)
|