[calligra] krita/image: Fix crash when updatable rect is empty

Dmitry Kazakov dimula73 at gmail.com
Thu Jun 9 16:04:30 CEST 2011


> I am. The merger shouldn't process empty rects. Unless you want to argue
> that the merger never should get empty rects in the first place: but even
> then, the merger should stop processing if it gets an empty rect.
>

Well, KisBaseRectsWalker checks for the emptiness of the rect and removes
empty jobs. But this case is not covered by this check, because applyRect in
KisUpdateOriginalVisitor is a calculated value and is not available during
preparational stage in KisBaseRectsWalker.

So, of course, we should check for the emptiness somewhere. And, currently,
we check this in filters. I don't think we should check this twice.

It would be good to try and fix all filters so they handle empty rects by
> returning without doing anything. However, that is something completely
> separate from making sure the merger doesn't try to merge empty rects.
>

Well, currently, all the filters should work with empty areas fine, because
all of them use (or should use) iterators. If they don't, they are broken.
Async merger relies on the guarantee, that the filter (at least) will not
crash when the area is empty. I don't see any reason in moving the guarantee
to the level of the caller, because in such a case we will have to fix all
the code calling filters to make our system consistent.

-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20110609/97d971f6/attachment.htm 


More information about the kimageshop mailing list