summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2014-02-07 20:08:10 +0000
committerJazzyNico <nicoduf@yahoo.fr>2014-02-07 20:08:10 +0000
commitec4c32a8921fc72e855f2ca8ec608af499dc34d2 (patch)
tree18c646a52a842b7a24acfc7acbaeb25ad09aeba2 /src/extension
parentSlightly improved fix to previous check-in. (diff)
downloadinkscape-ec4c32a8921fc72e855f2ca8ec608af499dc34d2.tar.gz
inkscape-ec4c32a8921fc72e855f2ca8ec608af499dc34d2.zip
Fix for Bug #1275443 (Including picture results in crash).
Fixed bugs: - https://launchpad.net/bugs/1275443 (bzr r13006)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/image-resolution.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/extension/internal/image-resolution.cpp b/src/extension/internal/image-resolution.cpp
index aee46aaba..18eb97f80 100644
--- a/src/extension/internal/image-resolution.cpp
+++ b/src/extension/internal/image-resolution.cpp
@@ -322,6 +322,12 @@ void ImageResolution::readjfif(char const *fn) {
y_ = cinfo.Y_density * 2.54;
ok_ = true;
}
+ /* According to http://www.jpeg.org/public/jfif.pdf (page 7):
+ * "Xdensity and Ydensity should always be non-zero".
+ * but in some cases, they are (see LP bug #1275443) */
+ if (x_ == 0 or y_ == 0) {
+ ok_ = false;
+ }
}
jpeg_destroy_decompress(&cinfo);
fclose(ifd);