Summary: | Palapeli crashed while creating a new puzzle (Grayscale image) [qt_fetchPixel, qt_fetchUntransformed, blend_untransformed_generic, ..., Pala::SlicerJob::addPieceFromMask] | ||
---|---|---|---|
Product: | [Applications] palapeli | Reporter: | Alain Perrot <alain.perrot> |
Component: | general | Assignee: | Stefan Majewsky <majewsky> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | andresbajotierra, cfeck, iandw.au, kde-games-bugs, phb, raptorsclaw, r_griffiths |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/palapeli/eff4a73ee36397885832e6e4f8dc8b622f5b2d5b | Version Fixed In: | 4.10.4 |
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
Indexed Colour image causes palapeli crash Proposed patch |
Description
Alain Perrot
2010-05-06 23:29:04 UTC
I think I figured a condition that makes Palapeli crash with some images but not others. Each time I try to create a puzzle from an image stored as grayscale, Palapeli crash. With the same images converted to be stored as RGB, there is no crash. Palapeli version 1.1 running on KDE 4.5 (Kubuntu Maverick packages) still segfaults when creating a puzzle from a grayscale image. [Comment from a bug triager] Testcase JPEG file that causes the crash: https://bugs.kde.org/attachment.cgi?id=55996 (from bug 263003) *** Bug 263003 has been marked as a duplicate of this bug. *** Created attachment 62161 [details]
New crash information added by DrKonqi
palapeli (1.2) on KDE Platform 4.6.2 (4.6.2) using Qt 4.7.0
- What I was doing when the application crashed:
Trying to create a puzzle (230 pieces) on a BW image (jpg). Previous bug report mentioned grayscale... well, that's BW.... it doesn't crash on color pictures. This was the first BW photo I tried it on. Crashed x2 in a row.
-- Backtrace (Reduced):
#10 0x00007f090d036974 in fillRect_normalized (r=<value optimized out>, data=0x2c09958, pe=<value optimized out>) at painting/qpaintengine_raster.cpp:1495
#11 0x00007f090d038a54 in QRasterPaintEngine::drawImage (this=<value optimized out>, p=<value optimized out>, img=<value optimized out>) at painting/qpaintengine_raster.cpp:2516
#12 0x00007f090cfc004f in QPainter::drawImage (this=0x7fff029fe490, p=..., image=...) at painting/qpainter.cpp:5555
#13 0x00007f08fa3de5a1 in drawImage (this=0x7fff029feb70, piece_id=<value optimized out>, path=<value optimized out>) at /usr/include/qt4/QtGui/qpainter.h:918
#14 GoldbergEngine::makePieceFromPath (this=0x7fff029feb70, piece_id=<value optimized out>, path=<value optimized out>) at ../../../palapeli/slicers/goldberg/goldberg-engine.cpp:227
Created attachment 62762 [details]
Indexed Colour image causes palapeli crash
Using Goldberg slicer creating puzzle crashes. Convert with gimp Image->Mode->RGB and save fixes the problem
*** Bug 304308 has been marked as a duplicate of this bug. *** Created attachment 74072 [details]
Proposed patch
Git commit fa3a58e6184423805891ae7dea37c9adc212eb88 by Christoph Feck. Committed on 18/10/2012 at 15:10. Pushed by cfeck into branch 'master'. Fix crash with grayscale images REVIEW: 106678 M +1 -1 src/creator/puzzlecreator.cpp http://commits.kde.org/palapeli/fa3a58e6184423805891ae7dea37c9adc212eb88 Git commit 89507fe6fa44e085a13823918aac5e755df643ea by Christoph Feck. Committed on 18/10/2012 at 15:10. Pushed by cfeck into branch 'KDE/4.9'. Fix crash with grayscale images FIXED-IN: 4.9.3 REVIEW: 106678 (cherry picked from commit fa3a58e6184423805891ae7dea37c9adc212eb88) M +1 -1 src/creator/puzzlecreator.cpp http://commits.kde.org/palapeli/89507fe6fa44e085a13823918aac5e755df643ea *** Bug 318783 has been marked as a duplicate of this bug. *** FWIW I was able to create a greyscale puzzle from this image using 100 rectangular pieces. When I selected normal piece-slicing, Palapeli vanished without any crash or backtrace. This was on an Apple Macbook using a Macports port of Palapeli 1.2 for KDE 4.10.1. Solving the puzzle worked well and finished correctly. It looks as though some slicers are working with greyscale but not others. Previous fix is wrong. I did not see that "image" was used before assigning it to the creationContext. New patch on the way. *** Bug 318783 has been marked as a duplicate of this bug. *** Ian, I basically moved the convertToFormat from previous patch to the line before the SlicerJob is created. Do you need a review request? No crash here with image from duplicate bug. diff --git a/src/creator/puzzlecreator.cpp b/src/creator/puzzlecreator.cpp index 655ed0d..28cca94 100644 --- a/src/creator/puzzlecreator.cpp +++ b/src/creator/puzzlecreator.cpp @@ -122,6 +122,7 @@ void Palapeli::PuzzleCreatorDialog::createPuzzle() KMessageBox::sorry(this, i18n("Puzzle cannot be created: The file you selected is not an image.")); return; } + image = image.convertToFormat(image.hasAlphaChannel() ? QImage::Format_ARGB32 : QImage::Format_RGB32); Pala::SlicerJob job(image, slicerArgs); job.setMode(selection.mode); if (!const_cast<Pala::Slicer*>(slicer)->process(&job)) //BIC: make Pala::Slicer::process() and run() const @@ -135,7 +136,7 @@ void Palapeli::PuzzleCreatorDialog::createPuzzle() creationContext.comment = m_commentEdit->text(); creationContext.author = m_authorEdit->text(); creationContext.pieceCount = job.pieces().count(); - creationContext.image = image.convertToFormat(image.hasAlphaChannel() ? QImage::Format_ARGB32 : QImage::Format_RGB32); + creationContext.image = image; creationContext.thumbnail = image.scaled(Palapeli::PuzzleMetadata::ThumbnailBaseSize, Qt::KeepAspectRatio); creationContext.modifyProtection = false; //only enabled for default puzzles creationContext.slicer = selection.slicerPluginName; No review required from me. Maybe Albert would like to have a look at your patch. Did you test some colored cases as well as greyscale? No regressions I hope. Git commit eff4a73ee36397885832e6e4f8dc8b622f5b2d5b by Christoph Feck. Committed on 07/05/2013 at 02:18. Pushed by cfeck into branch 'KDE/4.10'. Fix conversion to RGB format The previous fix was at the wrong place. FIXED-IN: 4.10.4 M +2 -1 src/creator/puzzlecreator.cpp http://commits.kde.org/palapeli/eff4a73ee36397885832e6e4f8dc8b622f5b2d5b Removing jessearrondavidjones@yahoo.com per abuse complaint. |