If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Fix compile Wmaybe-uninitialized warning on WebVTTListener.cpp

RESOLVED FIXED in Firefox 51

Status

()

Core
Audio/Video: Playback
P3
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: JamesCheng, Assigned: JamesCheng)

Tracking

unspecified
mozilla51
Points:
---

Firefox Tracking Flags

(firefox51 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
Try fix 
warning: 'cue' may be used uninitialized in this function [-Wmaybe-uninitialized]

Even the logic will check the rv without dereferencing the uninitialized pointer, having a initial value is a good.
Comment hidden (mozreview-request)
Component: Audio/Video → Audio/Video: Playback

Comment 2

a year ago
mozreview-review
Comment on attachment 8791033 [details]
Bug 1302591 - Fix compile Wmaybe-uninitialized warning on WebVTTListener.cpp.

https://reviewboard.mozilla.org/r/78592/#review77344

Thanks!

::: dom/media/WebVTTListener.cpp:165
(Diff revision 1)
>      return NS_ERROR_FAILURE;
>    }
>  
> -  TextTrackCue* cue;
> +  TextTrackCue* cue = nullptr;
>    nsresult rv = UNWRAP_OBJECT(VTTCue, &aCue.toObject(), cue);
>    NS_ENSURE_SUCCESS(rv, rv);

Right, the current implementation of UnwrapObject only returns NS_OK after setting cue.
Attachment #8791033 - Flags: review?(giles) → review+
(Assignee)

Updated

a year ago
Keywords: checkin-needed

Comment 3

a year ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1c708062f870
Fix compile Wmaybe-uninitialized warning on WebVTTListener.cpp. r=rillian
Keywords: checkin-needed

Comment 4

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1c708062f870
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.