GNOME Bugzilla – Bug 655794
Major bug in eog has_data function?
Last modified: 2011-08-09 20:02:25 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
(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.
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.