RFR: 8352209: NPE com.sun.prism.d3d.D3DTextureData.getContext [v3]

Ambarish Rapte arapte at openjdk.org
Mon Nov 3 11:21:29 UTC 2025


On Fri, 31 Oct 2025 11:03:39 GMT, Lukasz Kostyra <lkostyra at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/prism/impl/BaseContext.java line 111:
>> 
>>> 109: 
>>> 110:     protected final void flushMask() {
>>> 111:         if (maskTex != null && maskTex.isSurfaceLost()) return;
>> 
>> if maskTex is null the subsequent calls could throw NPE, so maybe this should be:
>> 
>> 
>>         if (maskTex == null || maskTex.isSurfaceLost()) return;
>
> Fair point. I think this code works regardless because originally `maskTex` was supposed to be guarded by `curMaskRow` and `curMaskCol` below being set to zero.
> 
> I will change it to the above.

If this change fixes this particular issue, then can the calls `!resource.isValid()` be removed ?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1951#discussion_r2486128563


More information about the openjfx-dev mailing list