aurelienpierreeng / ansel

A darktable fork minus the bloat plus some design vision.
https://ansel.photos
GNU General Public License v3.0
689 stars 22 forks source link

pixelpipe: check if `piece' is null to avoid crashes #375

Open agrn opened 1 month ago

agrn commented 1 month ago

pixelpipe_get_histogram_backbuf() can be called with piece set to NULL, which can lead to crashes under some conditions (e.g. when the crop filter is active) as it is directly dereferenced without checking its validity. Such a crash is mentioned in issue #357.

This PR adds a null pointer check before dereferencing piece, making the function return early if it is not successful.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Jiyone commented 1 month ago

This fix works 👍🏻