Changeset 247298 in webkit


Ignore:
Timestamp:
Jul 10, 2019 7:53:51 AM (5 years ago)
Author:
eocanha@igalia.com
Message:

[GStreamer] Protect against null samples and samples with null buffers
https://bugs.webkit.org/show_bug.cgi?id=199619

Reviewed by Philippe Normand.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

(WebCore::GstVideoFrameHolder::GstVideoFrameHolder): Assert to enforce non-null samples.
(WebCore::GstVideoFrameHolder::updateTexture): Protect against null m_buffer and improperly mapped video frame.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247295 r247298  
     12019-07-10  Enrique Ocaña González  <eocanha@igalia.com>
     2
     3        [GStreamer] Protect against null samples and samples with null buffers
     4        https://bugs.webkit.org/show_bug.cgi?id=199619
     5
     6        Reviewed by Philippe Normand.
     7
     8        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     9        (WebCore::GstVideoFrameHolder::GstVideoFrameHolder): Assert to enforce non-null samples.
     10        (WebCore::GstVideoFrameHolder::updateTexture): Protect against null m_buffer and improperly mapped video frame.
     11
    1122019-07-09  Andres Gonzalez  <andresg_22@apple.com>
    213
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r246730 r247298  
    138138    explicit GstVideoFrameHolder(GstSample* sample, TextureMapperGL::Flags flags, bool gstGLEnabled)
    139139    {
     140        RELEASE_ASSERT(GST_IS_SAMPLE(sample));
     141
    140142        GstVideoInfo videoInfo;
    141143        if (UNLIKELY(!getSampleVideoInfo(sample, videoInfo)))
     
    188190        ASSERT(!m_textureID);
    189191        GstVideoGLTextureUploadMeta* meta;
    190         if ((meta = gst_buffer_get_video_gl_texture_upload_meta(m_buffer))) {
     192        if (m_buffer && (meta = gst_buffer_get_video_gl_texture_upload_meta(m_buffer))) {
    191193            if (meta->n_textures == 1) { // BRGx & BGRA formats use only one texture.
    192194                guint ids[4] = { texture.id(), 0, 0, 0 };
     
    197199        }
    198200
     201        if (!m_isMapped)
     202            return;
     203
    199204        int stride = GST_VIDEO_FRAME_PLANE_STRIDE(&m_videoFrame, 0);
    200205        const void* srcData = GST_VIDEO_FRAME_PLANE_DATA(&m_videoFrame, 0);
     206
     207        if (!srcData)
     208            return;
     209
    201210        texture.updateContents(srcData, WebCore::IntRect(0, 0, m_size.width(), m_size.height()), WebCore::IntPoint(0, 0), stride);
    202211    }
Note: See TracChangeset for help on using the changeset viewer.