| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
The assertion needs to be the target of an implication (count > 0), as
it could legitimately be false if (count == 0).
https://bugzilla.gnome.org/show_bug.cgi?id=776990
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code just above checks whether image_module is NULL, and it doesn’t
look like it can change in the meantime, so we should also check before
dereferencing it for load_increment.
Make this an assertion; although we’re not entirely sure how this code
was originally supposed to work, we’re still in development, so we can
investigate any assertion failures with impunity.
Coverity CID: 1388529
https://bugzilla.gnome.org/show_bug.cgi?id=776990
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/hadess/gnome-thumbnailer-skeleton/commits/master
Add some assertions to help Coverity
From looking at the code, these assertions should always hold already,
but it clarifies the code and helps static analysis if we add them
explicitly.
(n_pixels == 0) is only true if (s_x1 == s_x2 || s_y1 == s_y2), which is
only true if (dx == 0 || dy == 0). This cannot be true, because dx and
dy are the result of dividing source_[width|height] by
dest_[width|height], and there’s already an assertion that the former
are greater or equal to the latter.
Coverity CID: 1388528
https://bugzilla.gnome.org/show_bug.cgi?id=776990
|
|
|
|
|
|
|
|
|
| |
If fseek() fails, the image is corrupt, and so the call to this get_buf
function should fail.
Coverity CID: 1388523
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refuse to save an invalid GdkPixbuf: one which has negative width,
height or number of channels.
This allows us to put assertions for all those properties in the I/O
code, which helps static analysis not go off on one because it thinks
the image width could be negative.
Coverity ID: 1388534
https://bugzilla.gnome.org/show_bug.cgi?id=777374
|
|
|
|
|
|
|
|
|
|
| |
ww and hh are both potentially tainted data (as they come from a
potentially attacker controlled file), so we need to ensure that all
arithmetic is bounds checked.
Coverity ID: 1388540
https://bugzilla.gnome.org/show_bug.cgi?id=777374
|
|
|
|
|
|
|
|
|
|
| |
The return values from the GdkPixbuf getters are signed, so assign them
to signed variables and then check that the returned values are
non-negative.
Coverity IDs: 1388535, 1388536, 1388537
https://bugzilla.gnome.org/show_bug.cgi?id=777374
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/hadess/gnome-thumbnailer-skeleton/commits/master
Add version checks around g_type_init() call
g_type_init() was deprecated (made unnecessary) in GLib 2.36.0, so don’t
call it if we are compiled against a new enough version of GLib.
https://bugzilla.gnome.org/show_bug.cgi?id=777315
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Return an error if the image width or height are too big to fit in the
BMP size fields.
This bumps our GLib dependency to 2.48.0, as it uses
g_uint_checked_mul(). If you want to backport this fix, it’s probably
best to use __builtin_umul_overflow() directly (if compiling using GCC
or another compiler which supports it).
Coverity ID: 1388532
https://bugzilla.gnome.org/show_bug.cgi?id=777315
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recommended way to do an overflow check is to check against the
limit you have in mind, rather than doing the calculation and seeing if
it failed.
Fix this by rearranging the check: move the variables we control (or
have previously checked) over to one side, leaving the unknown variable
on its own on the left-hand side. This ensures the overflow check
doesn’t overflow itself.
Coverity ID: 1388538
https://bugzilla.gnome.org/show_bug.cgi?id=777315
|
| |
|
|
|
|
|
|
| |
Now that scaling down by huge factors is fixed, we can deprecate the
work-arounds from other libraries. This means they require the newer
version, so bump the version so it's identifiable.
|
|
|
|
|
|
|
|
| |
Test the output of scaling functions to see whether
optimisation/simplification to avoid huge memory and CPU usage is
effective and does not regress.
https://bugzilla.gnome.org/show_bug.cgi?id=80925
|
|
|
|
|
|
| |
Those will be used in the 2-step scaler tests.
https://bugzilla.gnome.org/show_bug.cgi?id=80925
|
|
|
|
|
|
|
| |
As scaling becomes incredibly slow at high reduction factors, detect the
pathological cases and do the scaling in two steps instead.
https://bugzilla.gnome.org/show_bug.cgi?id=80925
|
| |
|
|
|
|
|
| |
Some auxillary scripts and NMake Makefiles must have their paths updated
also to work properly.
|
|
|
|
|
|
|
|
| |
This moves the Visual Studio project files and related items under win32/
so that people can go one less directory layer down to the Visual Studio
projects. This also makes things in sync with what is now on GLib and GTK+,
and cleans up the Visual Studio 201x projects as some items can actually be
combined.
|
| |
|
|
|
|
|
|
|
|
| |
If calling gdk_pixbuf_scale_simple() with equal src and dest dimensions,
there’s nothing to do, so just return a copy of the src pixbuf. Document
the new fast path.
https://bugzilla.gnome.org/show_bug.cgi?id=442452
|
|
|
|
|
|
| |
There are not many, as far as I can see.
https://bugzilla.gnome.org/show_bug.cgi?id=442452
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=442452
|
|
|
|
|
|
|
| |
It’s a slightly more accurate term, as compositing seems to mostly refer
to bit-mask composition of two images, rather than blending.
https://bugzilla.gnome.org/show_bug.cgi?id=442452
|
|
|
|
|
|
| |
That one moved to gdk-pixbuf-xlib a while ago.
https://bugzilla.gnome.org/show_bug.cgi?id=442452
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 6afda9c removed the separate height and width arguments, as we
always want to keep the original image's aspect ratio. The cleanup
wasn't quite finished though, and ended up with slightly non-sensical
checks (like doing comparisons twice).
Coverity CID 1388524
https://bugzilla.gnome.org/show_bug.cgi?id=768062
|
|
|
|
|
|
|
|
|
|
|
| |
In the unlikely case that the just created pixbuf is invalid, the
returned sizes would be negative. Ensure that those are positive
to avoid possible infinite loops.
Coverity CID 1391987
Coverity CID 1391988
https://bugzilla.gnome.org/show_bug.cgi?id=776945
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The upper and lower bounds when an area is updated are inclusive
coordinates, so the height would be upper - lower + 1, not
upper - lower, which would exclude the upper line.
https://bugzilla.gnome.org/show_bug.cgi?id=581484
|
|
|
|
|
|
|
|
| |
This time for the GIF animation.
Adapted from Andrey Tsyvarev's original animation test program.
https://bugzilla.gnome.org/show_bug.cgi?id=581484
|
| |
|
|
|
|
|
|
|
| |
When the icon is constructed bottom to top, the y coordinates were
incorrectly computed.
https://bugzilla.gnome.org/show_bug.cgi?id=581484
|
|
|
|
|
|
| |
Adapted from Andrey Tsyvarev's original test program.
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.
|
|
|
|
|
|
|
|
|
| |
The debug output was always printing the very first pixel of the line as
both the reference and test data, leading to "useful" output like:
Image data at 1x1 is #B16C42FF, but should be #B16C42FF
Read the reference and test pixel values from the correct offset in the
line to fix this.
|
|
|
|
|
|
| |
It currently errors out with "TGA image was truncated or incomplete".
https://bugzilla.gnome.org/show_bug.cgi?id=575217
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=685543
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=685543
|
|
|
|
|
| |
Fix incorrect _close()/_get_pixbuf() call order, a possible
g_object_unref() on a NULL pixbuf, and handling of GIF animations.
|
|
|
|
|
|
|
|
|
| |
Ideally, we should only be comparing data that the loader told us it
updated, and this is kind of what we're doing, as long as we don't have
a legitimate image that uses the exact same filler colour. Unlikely
though.
https://bugzilla.gnome.org/show_bug.cgi?id=696331
|
|
|
|
|
|
|
|
| |
As we cannot easily detect truncated images when feeding data piecemeal,
initialise the empty image to avoid reading uninitialised memory where
we could not fill the pixbuf.
https://bugzilla.gnome.org/show_bug.cgi?id=696331
|
|
|
|
|
|
|
| |
This colour should be used to complete truncated images, rather than
using random garbage from uninitialised memory.
https://bugzilla.gnome.org/show_bug.cgi?id=696331
|
|
|
|
|
|
|
|
| |
This compares a broken file, which might have random data inside the
part of the image that was missing from the file, with our version
which will have a flat colour instead.
https://bugzilla.gnome.org/show_bug.cgi?id=696331
|
|
|
|
|
|
|
|
| |
This makes it easier to create a reference image after a bug has been
fixed. Reverting the fix is enough to show that the reftest fails
without it.
https://bugzilla.gnome.org/show_bug.cgi?id=696331
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=776457
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=776457
|
|
|
|
|
|
|
| |
Fixes the build on Windows and elsewhere, where there's a filename
extension for executables
https://bugzilla.gnome.org/show_bug.cgi?id=776432
|