DevHeads.net

Review Request: limit the amount of columns & rows of any layer

Review request for kdelibs.

Description
Looking at the xcf loader in gimp, I think the limit could be 16 or 255, but 1024 also works.
The bad xcf in the bug tries to create around 3600000 rows and columns, filling all the memory in seconds (until linux kills the process).
That way, the maximum memory for that file is only around 256M.
By the way, the gimp is also unable to open that file.

This addresses bug 234030.
<a href="http://bugs.kde.org/show_bug.cgi?id=234030" title="http://bugs.kde.org/show_bug.cgi?id=234030">http://bugs.kde.org/show_bug.cgi?id=234030</a>

Diffs
kimgio/xcf.cpp 2a03d03

Diff: <a href="http://git.reviewboard.kde.org/r/102800/diff/diff" title="http://git.reviewboard.kde.org/r/102800/diff/diff">http://git.reviewboard.kde.org/r/102800/diff/diff</a>

Testing
not oom killer in action.

Thanks,

Jaime Torres Amate