diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-12-26 09:33:12 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-12-26 09:33:12 +0000 |
| commit | 699f7c4387074fd3342f55c4597c8cd3bdfd07d1 (patch) | |
| tree | c7ff4f527f93a070a9ab170916e763fa17114900 /src/object | |
| parent | test missing image xlink:href attribute (diff) | |
| download | inkscape-699f7c4387074fd3342f55c4597c8cd3bdfd07d1.tar.gz inkscape-699f7c4387074fd3342f55c4597c8cd3bdfd07d1.zip | |
fix crash with missing image xlink:href attribute
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/sp-image.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/object/sp-image.cpp b/src/object/sp-image.cpp index f3be15b53..45016bd45 100644 --- a/src/object/sp-image.cpp +++ b/src/object/sp-image.cpp @@ -414,6 +414,12 @@ void SPImage::update(SPCtx *ctx, unsigned int flags) { // TODO: eliminate ox, oy, sx, sy sp_image_update_canvas_image ((SPImage *) this); + + // don't crash with missing xlink:href attribute + if (!this->pixbuf) { + return; + } + double proportion_pixbuf = this->pixbuf->height() / (double)this->pixbuf->width(); double proportion_image = this->height.computed / (double)this->width.computed; if (this->prev_width && |
