Skip to content

Commit 3b3a227

Browse files
committed
Avoid crashing when the video sink does not have stats
In the Sagemcom box without westeros, it crashes. This was fixed upstream as commit that could not be backported because of the differences with upstream. This one: commit 4f4db5a (HEAD -> main, origin/main, origin/HEAD) Author: Xabier Rodriguez-Calvar <calvaris@igalia.com> Date: Thu Sep 19 22:40:41 2024 -0700 [GStreamer] Do not access a null GstStructure https://bugs.webkit.org/show_bug.cgi?id=279972 Reviewed by Philippe Normand. Stats can be null in some sinks so we avoid accessing them in that case. For the same prize we protect the access to null structures in the GstStructure accessors. * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::gstStructureGet): (WebCore::gstStructureGetString): (WebCore::gstStructureGetName): * Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::updateVideoSinkStatistics): Canonical link: https://commits.webkit.org/283974@main
1 parent 0cb500e commit 3b3a227

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,6 +4219,9 @@ bool MediaPlayerPrivateGStreamer::updateVideoSinkStatistics()
42194219
GUniqueOutPtr<GstStructure> stats;
42204220
g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr);
42214221

4222+
if (!stats)
4223+
return false;
4224+
42224225
if (!gst_structure_get_uint64(stats.get(), "rendered", &totalVideoFrames))
42234226
return false;
42244227

0 commit comments

Comments
 (0)