After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 655794 - Major bug in eog has_data function?
Major bug in eog has_data function?
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
unspecified
Other Linux
: High major
: GNOME3.2
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-02 10:59 UTC by Fabian Sturm
Modified: 2011-08-09 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fabian Sturm 2011-08-02 10:59:45 UTC
Hi,

I think I found a major bug in eog in eog-image.c line 1201ff. in the has_data method.

The code looks like this:

  req_data = (req_data & !EOG_IMAGE_DATA_IMAGE);

but should look like this:

  req_data = (req_data & ~EOG_IMAGE_DATA_IMAGE);

If the bug is corrected a second bug surfaces. If you don't have libexif available the has_data method will return false and eog will stop with an assertion:

EOG:ERROR:eog-window.c:1183:eog_window_display_image: assertion failed: (eog_image_has_data (image, EOG_IMAGE_DATA_ALL))

Sincerely Fabian
Comment 1 Felix Riemann 2011-08-02 17:44:52 UTC
(In reply to comment #0)
> Hi,
> 
> I think I found a major bug in eog in eog-image.c line 1201ff. in the has_data
> method.
> 
> The code looks like this:
> 
>   req_data = (req_data & !EOG_IMAGE_DATA_IMAGE);
> 
> but should look like this:
> 
>   req_data = (req_data & ~EOG_IMAGE_DATA_IMAGE);

Oh, no! You are most likely right about these. :)
Interesting though that this didn't cause really bad effects in the ~5 years we are using this function now.
 
> If the bug is corrected a second bug surfaces. If you don't have libexif
> available the has_data method will return false and eog will stop with an
> assertion:
> 
> EOG:ERROR:eog-window.c:1183:eog_window_display_image: assertion failed:
> (eog_image_has_data (image, EOG_IMAGE_DATA_ALL))

This likely due to a misunderstanding in _has_data's logic. We'll need to check the invocations of _has_data anyway now, so I guess we'll find more of these faults.
Comment 2 Felix Riemann 2011-08-09 20:02:25 UTC
commit 40919ebb2ce1fd70edae61c7b578c6a7ce8ef432
Author: Felix Riemann <>
Date:   Tue Aug 2 23:18:19 2011 +0200

    Fix bogus usage of eog_image_has_data()
    
    This tries to fix cases where it apparently wasn't taken into account
    that if you use the function with multiple test flags all tests must be
    successful or the result will be negative.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655794

commit ffd057a0be9610b49f2dc718060c82c4ee1065be
Author: Felix Riemann <>
Date:   Tue Aug 2 22:02:17 2011 +0200

    Fix test selection handling in eog_image_has_data()
    
    Due to a wrong value negation the function was only checking one of the
    selected data types and skipping the following tests.
    Spotted by Fabian Sturm.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655794

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.