RFR: 8271398: GTK3 drag view image swaps red and blue color channels [v4]

Thiago Milczarek Sayao tsayao at openjdk.java.net
Fri Sep 17 13:00:24 UTC 2021


On Thu, 16 Sep 2021 21:57:08 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Thiago Milczarek Sayao has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review requests.
>
> modules/javafx.graphics/src/main/native-glass/gtk/glass_dnd.cpp line 916:
> 
>> 914: 
>> 915:                         if (is_raw_image) {
>> 916:                             data = (guchar*) convert_BGRA_to_RGBA((const int*) data, w * 4, h);
> 
> This will leak memory, since the original buffer allocated by the call to `g_try_malloc0` on line 911 is never freed. I recommend something like this:
> 
> 
>         guchar* origdata = data;
>         data = (guchar*) convert_BGRA_to_RGBA((const int*) origdata, w * 4, h);
>         g_free(origdata);

Fixed. I really felt something was missing :)

-------------

PR: https://git.openjdk.java.net/jfx/pull/599


More information about the openjfx-dev mailing list