[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - vcl/qa vcl/source
Caolán McNamara
caolanm at redhat.com
Thu Sep 17 00:55:37 PDT 2015
vcl/qa/cppunit/graphicfilter/data/jpg/fail/crash-1.jpg |binary
vcl/source/filter/jpeg/jpegc.cxx | 8 +++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 4492a4cf9f37dc024c02ef00cccdd3b2262c5d80
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 16 15:10:18 2015 +0100
don't crash with unknown out color space
Change-Id: Ib066ff1fad686d611a86510e768b1109ef7a5e75
(cherry picked from commit 7aa2f8c75d7bda103748fa73766a30fd77e50c16)
Reviewed-on: https://gerrit.libreoffice.org/18641
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/vcl/qa/cppunit/graphicfilter/data/jpg/fail/crash-1.jpg b/vcl/qa/cppunit/graphicfilter/data/jpg/fail/crash-1.jpg
new file mode 100644
index 0000000..e783bd3
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/jpg/fail/crash-1.jpg differ
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index 411b17b..25b98fb 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -94,7 +94,13 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
else if ( cinfo.jpeg_color_space == JCS_YCCK )
cinfo.out_color_space = JCS_CMYK;
- OSL_ASSERT(cinfo.out_color_space == JCS_CMYK || cinfo.out_color_space == JCS_GRAYSCALE || cinfo.out_color_space == JCS_RGB);
+ if (cinfo.out_color_space != JCS_CMYK &&
+ cinfo.out_color_space != JCS_GRAYSCALE &&
+ cinfo.out_color_space != JCS_RGB)
+ {
+ SAL_WARN("vcl.filter", "jpg with unknown out color space, forcing to rgb");
+ cinfo.out_color_space = JCS_RGB;
+ }
/* change scale for preview import */
long nPreviewWidth = previewSize.Width();
More information about the Libreoffice-commits
mailing list