Closed Bug 1302591 Opened 8 years ago Closed 8 years ago

Fix compile Wmaybe-uninitialized warning on WebVTTListener.cpp

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: JamesCheng, Assigned: JamesCheng)

Details

Attachments

(1 file)

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.
Component: Audio/Video → Audio/Video: Playback
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+
Keywords: checkin-needed
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
https://hg.mozilla.org/mozilla-central/rev/1c708062f870
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: