Merge lp:~jpakkane/thumbnailer/exifcrash into lp:thumbnailer

Proposed by Jussi Pakkanen
Status: Merged
Approved by: Bill Filler
Approved revision: 76
Merged at revision: 75
Proposed branch: lp:~jpakkane/thumbnailer/exifcrash
Merge into: lp:thumbnailer
Diff against target: 30 lines (+11/-9)
1 file modified
src/imagescaler.cpp (+11/-9)
To merge this branch: bzr merge lp:~jpakkane/thumbnailer/exifcrash
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+211672@code.launchpad.net

Commit message

Prevent crash if exif entry is null.

Description of the change

Prevent crash if exif entry is null.

To post a comment you must log in.
lp:~jpakkane/thumbnailer/exifcrash updated
76. By Jussi Pakkanen

More dense.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, fixed the crash

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imagescaler.cpp'
2--- src/imagescaler.cpp 2014-03-05 09:29:45 +0000
3+++ src/imagescaler.cpp 2014-03-19 06:57:51 +0000
4@@ -62,15 +62,17 @@
5 // https://bugzilla.gnome.org/show_bug.cgi?id=725582
6 if(ed) {
7 ExifEntry *e = exif_data_get_entry(ed, EXIF_TAG_ORIENTATION);
8- int orientation = exif_get_short(e->data, exif_data_get_byte_order(ed));
9- if(orientation == 6) {
10- rot = gdk_pixbuf_rotate_simple(src, GDK_PIXBUF_ROTATE_CLOCKWISE);
11- } else if (orientation == 8) {
12- rot = gdk_pixbuf_rotate_simple(src, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
13- } else if (orientation == 3) {
14- rot = gdk_pixbuf_rotate_simple(src, GDK_PIXBUF_ROTATE_UPSIDEDOWN);
15- } else {
16- // We don't do mirrored images, at least not yet.
17+ if(e) {
18+ int orientation = exif_get_short(e->data, exif_data_get_byte_order(ed));
19+ if(orientation == 6) {
20+ rot = gdk_pixbuf_rotate_simple(src, GDK_PIXBUF_ROTATE_CLOCKWISE);
21+ } else if (orientation == 8) {
22+ rot = gdk_pixbuf_rotate_simple(src, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
23+ } else if (orientation == 3) {
24+ rot = gdk_pixbuf_rotate_simple(src, GDK_PIXBUF_ROTATE_UPSIDEDOWN);
25+ } else {
26+ // We don't do mirrored images, at least not yet.
27+ }
28 }
29 }
30 if(!rot) {

Subscribers

People subscribed via source and target branches

to all changes: