Bug 212629 - m_userActivatedMediaFinishedPlayingTimestamp is used uninitialized
Summary: m_userActivatedMediaFinishedPlayingTimestamp is used uninitialized
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yoshiaki Jitsukawa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-02 01:03 PDT by Yoshiaki Jitsukawa
Modified: 2023-09-20 03:13 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.85 KB, patch)
2020-06-02 01:14 PDT, Yoshiaki Jitsukawa
yoshiaki.jitsukawa: review?
yoshiaki.jitsukawa: commit-queue?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshiaki Jitsukawa 2020-06-02 01:03:32 PDT
In Document::processingUserGestureForMedia() m_userActivatedMediaFinishedPlayingTimestamp may be
used before being set and in that case the function can return wrong result.
Comment 1 Yoshiaki Jitsukawa 2020-06-02 01:14:50 PDT
Created attachment 400793 [details]
Patch
Comment 2 youenn fablet 2020-06-02 08:49:53 PDT
Comment on attachment 400793 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=400793&action=review

> Source/WebCore/dom/Document.cpp:6826
> +    if (m_userActivatedMediaFinishedPlayingTimestamp && (m_userActivatedMediaFinishedPlayingTimestamp + maxIntervalForUserGestureForwardingAfterMediaFinishesPlaying >= MonotonicTime::now()))

Can you explain the issue? Is it that MonotonicTime::now might return a value close to 0 on the playstation?
I would expect in general MonotonicTime::now() to have a high value so that, if m_userActivatedMediaFinishedPlayingTimestamp is zero, we always fail the if check.
Comment 3 Yoshiaki Jitsukawa 2020-07-07 18:35:38 PDT
(In reply to youenn fablet from comment #2)
> Comment on attachment 400793 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=400793&action=review
> 
> > Source/WebCore/dom/Document.cpp:6826
> > +    if (m_userActivatedMediaFinishedPlayingTimestamp && (m_userActivatedMediaFinishedPlayingTimestamp + maxIntervalForUserGestureForwardingAfterMediaFinishesPlaying >= MonotonicTime::now()))
> 
> Can you explain the issue? Is it that MonotonicTime::now might return a
> value close to 0 on the playstation?
> I would expect in general MonotonicTime::now() to have a high value so that,
> if m_userActivatedMediaFinishedPlayingTimestamp is zero, we always fail the
> if check.

Sorry for late reply.
Yes, on the playstation port MonotonicTime::now() may return such a value.

If m_userActivatedMediaFinishedPlayingTimestamp is zero, it implies that nobody has set it, correct?
Comment 4 Peng Liu 2020-08-24 10:31:13 PDT
Comment on attachment 400793 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=400793&action=review

>>> Source/WebCore/dom/Document.cpp:6826
>>> +    if (m_userActivatedMediaFinishedPlayingTimestamp && (m_userActivatedMediaFinishedPlayingTimestamp + maxIntervalForUserGestureForwardingAfterMediaFinishesPlaying >= MonotonicTime::now()))
>> 
>> Can you explain the issue? Is it that MonotonicTime::now might return a value close to 0 on the playstation?
>> I would expect in general MonotonicTime::now() to have a high value so that, if m_userActivatedMediaFinishedPlayingTimestamp is zero, we always fail the if check.
> 
> Sorry for late reply.
> Yes, on the playstation port MonotonicTime::now() may return such a value.
> 
> If m_userActivatedMediaFinishedPlayingTimestamp is zero, it implies that nobody has set it, correct?

Sounds like MonotonicTime::now() has some issue on the playstation port?
Comment 5 Ahmad Saleem 2023-09-20 03:13:28 PDT
This didn't landed:

https://searchfox.org/wubkat/source/Source/WebCore/dom/Document.cpp#7621

Do we need this?