Changeset 278925 in webkit


Ignore:
Timestamp:
Jun 16, 2021, 1:15:54 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer] clang analysis: Unlocked access in ImageDecoderGStreamer.cpp
https://bugs.webkit.org/show_bug.cgi?id=226495

Patch by Philippe Normand <pnormand@igalia.com> on 2021-06-16
Reviewed by Adrian Perez de Castro.

Remove unlocked access to the the m_messageDispatched instance variable. Also there is no
need to wait on the condition if the dispatching happens synchronously in the current
thread. No need to notify the condition either before dispatching, the only call to wait()
is after the asynchronous dispatch has been scheduled.

  • platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:

(WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r278923 r278925  
     12021-06-16  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer] clang analysis: Unlocked access in ImageDecoderGStreamer.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=226495
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        Remove unlocked access to the the m_messageDispatched instance variable. Also there is no
     9        need to wait on the condition if the dispatching happens synchronously in the current
     10        thread. No need to notify the condition either before dispatching, the only call to wait()
     11        is after the asynchronous dispatch has been scheduled.
     12
     13        * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
     14        (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):
     15
    1162021-06-16  Martin Robinson  <mrobinson@webkit.org>
    217
  • trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp

    r278892 r278925  
    374374            Locker locker { decoder.m_messageLock };
    375375            decoder.m_messageDispatched = false;
    376             decoder.m_messageCondition.notifyOne();
    377376        }
    378377        if (&decoder.m_runLoop == &RunLoop::current())
     
    385384                    weakThis->handleMessage(protectedMessage.get());
    386385            });
    387         }
    388         if (!decoder.m_messageDispatched) {
    389             Locker locker { decoder.m_messageLock };
    390             decoder.m_messageCondition.wait(decoder.m_messageLock);
     386            {
     387                Locker locker { decoder.m_messageLock };
     388                if (!decoder.m_messageDispatched)
     389                    decoder.m_messageCondition.wait(decoder.m_messageLock);
     390            }
    391391        }
    392392        gst_message_unref(message);
Note: See TracChangeset for help on using the changeset viewer.