On Tue, 4 Aug 2026 16:04:30 GMT, Kevin Rushforth <[email protected]> wrote:

>> Roman Marchenko has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   fix review comments
>
> modules/javafx.media/src/main/native/gstreamer/plugins/dshowwrapper/Allocator.cpp
>  line 71:
> 
>> 69:     m_pBuffer = NULL;
>> 70:     if (FAILED(hr))
>> 71:         return hr;
> 
> If `SetGstBuffer` fails, I think you need to release the sample and clear 
> `*ppBuffer` to avoid leaking sample buffers, since the caller doesn't in the 
> case of a reported failure. Maybe something like this?
> 
> 
>     if (FAILED(hr)) {
>         pSample->Release();
>         *ppBuffer = null;
>         return hr;
>     }

@kevinrushforth 
If so, then I think we need to release the sample after a failed `GetGstBuffer` 
as well, am I right?
Like

        if (GetGstBuffer != NULL)
            GetGstBuffer(&m_pBuffer, m_lSize, &m_UserData);

        if (m_pBuffer == NULL)
        {
            pSample->Release();
            *ppBuffer = NULL;
            return E_FAIL;
        }

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2234#discussion_r3714395408

Reply via email to