[Merge] ~kondor-dani/compiz:annotate_fix into compiz:master

Dmitry Shachnev mitya57 at gmail.com
Thu May 14 12:41:59 UTC 2020


Review: Needs Information

I am setting it to Needs Information per Alberts' review.

Diff comments:

> diff --git a/plugins/annotate/src/annotate.cpp b/plugins/annotate/src/annotate.cpp
> index f415d6c..7492de7 100644
> --- a/plugins/annotate/src/annotate.cpp
> +++ b/plugins/annotate/src/annotate.cpp
> @@ -299,10 +299,12 @@ AnnoScreen::draw (CompAction         *action,
>  
>      if (cr)
>      {
> +	std::string tool_str;
>  	const char	*tool;
>  	unsigned short	*fillColor, *strokeColor;
>  
> -	tool = CompOption::getStringOptionNamed (options, "tool", "line").c_str ();
> +	tool_str = CompOption::getStringOptionNamed (options, "tool", "line");
> +	tool = tool_str.c_str ();

I agree with Alberts here. This does not look like undefined behavior, and similar code is used in a few more places in this file.

If tool gets overridden for some reason (how exactly?) then maybe you can find the exact line which changes it, or check if there are errors from valgrind?

>  
>  	cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
>  	cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);


-- 
https://code.launchpad.net/~kondor-dani/compiz/+git/compiz/+merge/383948
Your team Compiz Maintainers is subscribed to branch compiz:master.



More information about the Ubuntu-reviews mailing list