Skip to content

Commit

Permalink
histogram: avoid dereferencing null profile pointer.
Browse files Browse the repository at this point in the history
Also add a on-display log information about the profile being
replaced by Rec2020.

Fixes #15370.
  • Loading branch information
TurboGit committed Oct 6, 2023
1 parent f555997 commit 461d707
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/libs/histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,15 @@ static void _lib_histogram_process_vectorscope
if(!vs_prof || !dt_is_valid_colormatrix(vs_prof->matrix_in[0][0]))
{
dt_print(DT_DEBUG_ALWAYS,
"[histogram] unsupported vectorscope profile %i %s, it will be replaced with linear Rec2020\n",
vs_prof->type, vs_prof->filename);
vs_prof = dt_ioppr_add_profile_info_to_list(darktable.develop, DT_COLORSPACE_LIN_REC2020, "", DT_INTENT_RELATIVE_COLORIMETRIC);
"[histogram] unsupported vectorscope profile %i %s,"
" it will be replaced with linear Rec2020\n",
vs_prof ? vs_prof->type : 0,
vs_prof ? vs_prof->filename : "unsupported");
dt_control_log(_("unsupported vectorscope profile selected,"
" it will be replaced with linear Rec2020"));
vs_prof = dt_ioppr_add_profile_info_to_list
(darktable.develop,
DT_COLORSPACE_LIN_REC2020, "", DT_INTENT_RELATIVE_COLORIMETRIC);
}

_lib_histogram_vectorscope_bkgd(d, vs_prof);
Expand Down

0 comments on commit 461d707

Please sign in to comment.