Bug 344437

Summary: Some brushes create NAN colors in 16bit floating point
Product: [Applications] krita Reporter: wolthera <griffinvalley>
Component: Color modelsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla, joupent, romuluspb
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Nan colours are the pixelly black ones to the right.
This brush creates nan-colours at it's start...

Description wolthera 2015-02-22 00:19:37 UTC
Uhm... so, this is a thing I managed to do...

Reproducible: Always

Steps to Reproduce:
1. make a 16bit float krita file
2. Use either a) gaussian blur on objects, or b) the brush I will attach.
3. Gaussian blur will result in a black blobby mess that while reported as black, doesn't actually act like black(smudge it)
Comment 1 wolthera 2015-02-22 00:20:49 UTC
Created attachment 91207 [details]
Nan colours are the pixelly black ones to the right.
Comment 2 wolthera 2015-02-22 00:23:05 UTC
Created attachment 91208 [details]
This brush creates nan-colours at it's start...
Comment 3 romuluspb 2015-04-17 20:34:23 UTC
I was able to go around the problem by using some specific brushes from shadow system:

Hatch_cross_small
Hatch_diag_fat
Hatch_diag_S

appear to sane the pixels, tried working in the area again and apparently is all ok
Comment 4 Halla Rempt 2015-04-18 16:00:38 UTC
Hah, that probably means that the hatch brush uses 8 bit colors internally... Not good!
Comment 5 joupent 2017-12-11 16:10:22 UTC
Git commit 2f888b32d70f91a206addaf43a2eea94d1b26909 by Jouni Pentikäinen.
Committed on 11/12/2017 at 16:09.
Pushed by jounip into branch 'master'.

Fix NaN values from hairy brushes

A hairy brush with ink deplation enabled for opacity, without
weights, would use unitialized data from Bristle::m_inkAmount
which would later get converted from double to float.

Bristle members are now always initialized, and intermediary
values clamped to correct range.

M  +6    -19   plugins/paintops/hairy/bristle.cpp
M  +9    -9    plugins/paintops/hairy/bristle.h
M  +6    -7    plugins/paintops/hairy/hairy_brush.cpp

https://commits.kde.org/krita/2f888b32d70f91a206addaf43a2eea94d1b26909
Comment 6 joupent 2018-10-09 11:44:51 UTC
Since there have been no new sightings of this bug, I can only assume the fix to the hairy brushes has resolved it.