WebKit Bugzilla
Attachment 373717 Details for
Bug 199619
: [GStreamer] Protect against null samples and samples with null buffers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199619-20190709144206.patch (text/plain), 4.13 KB, created by
Enrique Ocaña
on 2019-07-09 07:42:07 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Enrique Ocaña
Created:
2019-07-09 07:42:07 PDT
Size:
4.13 KB
patch
obsolete
>Subversion Revision: 247207 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ad415c97f98ac9b08d3aabe279a27aa566ed9b50..8c6fe565e1020ec99374c24d35e51bc1af054de3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-07-09 Enrique Ocaña González <eocanha@igalia.com> >+ >+ [GStreamer] Protect against null samples and samples with null buffers >+ https://bugs.webkit.org/show_bug.cgi?id=199619 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::GstVideoFrameHolder::GstVideoFrameHolder): Early return on null samples. >+ (WebCore::GstVideoFrameHolder::updateTexture): Protect against null m_buffer and improperly mapped video frame. >+ (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): Early return on null buffer in the sample. >+ (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture): Ditto. >+ (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime): Ditto. >+ > 2019-07-08 Antoine Quint <graouts@apple.com> > > [Pointer Events] Enable only on the most recent version of the supported iOS family >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index d03d4b58a9abcd47ec1da5978c2db04f286361ed..c15163d8562dbb11c071b992b7133c71b5ee6ebe 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -138,7 +138,7 @@ public: > explicit GstVideoFrameHolder(GstSample* sample, TextureMapperGL::Flags flags, bool gstGLEnabled) > { > GstVideoInfo videoInfo; >- if (UNLIKELY(!getSampleVideoInfo(sample, videoInfo))) >+ if (UNLIKELY(!(sample && getSampleVideoInfo(sample, videoInfo)))) > return; > > m_size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)); >@@ -187,7 +187,7 @@ public: > { > ASSERT(!m_textureID); > GstVideoGLTextureUploadMeta* meta; >- if ((meta = gst_buffer_get_video_gl_texture_upload_meta(m_buffer))) { >+ if (m_buffer && (meta = gst_buffer_get_video_gl_texture_upload_meta(m_buffer))) { > if (meta->n_textures == 1) { // BRGx & BGRA formats use only one texture. > guint ids[4] = { texture.id(), 0, 0, 0 }; > >@@ -196,8 +196,15 @@ public: > } > } > >+ if (!m_isMapped) >+ return; >+ > int stride = GST_VIDEO_FRAME_PLANE_STRIDE(&m_videoFrame, 0); > const void* srcData = GST_VIDEO_FRAME_PLANE_DATA(&m_videoFrame, 0); >+ >+ if (!srcData) >+ return; >+ > texture.updateContents(srcData, WebCore::IntRect(0, 0, m_size.width(), m_size.height()), WebCore::IntPoint(0, 0), stride); > } > >@@ -686,7 +693,7 @@ void MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded() > void MediaPlayerPrivateGStreamerBase::pushTextureToCompositor() > { > auto sampleLocker = holdLock(m_sampleMutex); >- if (!GST_IS_SAMPLE(m_sample.get())) >+ if (!(GST_IS_SAMPLE(m_sample.get()) && gst_sample_get_buffer(m_sample.get()))) > return; > > auto proxyOperation = >@@ -896,7 +903,7 @@ bool MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture(Graphics > > auto sampleLocker = holdLock(m_sampleMutex); > >- if (!GST_IS_SAMPLE(m_sample.get())) >+ if (!(GST_IS_SAMPLE(m_sample.get()) && gst_sample_get_buffer(m_sample.get()))) > return false; > > std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), m_textureMapperFlags, true); >@@ -923,7 +930,7 @@ NativeImagePtr MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime() > > auto sampleLocker = holdLock(m_sampleMutex); > >- if (!GST_IS_SAMPLE(m_sample.get())) >+ if (!(GST_IS_SAMPLE(m_sample.get()) && gst_sample_get_buffer(m_sample.get()))) > return nullptr; > > std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), m_textureMapperFlags, true);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199619
:
373717
|
373830