Bug 138867

Summary: Missing NULL-check in VideoTrack::setLanguage
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: MediaAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, commit-queue, eric.carlson, esprehn+autocc, glenn, gyuyoung.kim, jer.noble, philipj, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch jer.noble: review+

Description Philippe Normand 2014-11-19 03:52:18 PST
Here media/track/track-in-band-duplicate-tracks-when-source-changes.html crashes:

#0  0x00007f0ccdfc220b in WebCore::HTMLMediaElement::videoTracks() () from /home/phil/dev/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
(gdb) bt
#0  0x00007f0ccdfc220b in WebCore::HTMLMediaElement::videoTracks() () from /home/phil/dev/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#1  0x00007f0cce80eabc in WebCore::VideoTrack::setLanguage(WTF::AtomicString const&) () from /home/phil/dev/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#2  0x00007f0cce87e929 in WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged() () from /home/phil/dev/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3  0x00007f0cceecf5fd in WTF::GThreadSafeMainLoopSource::voidCallback() () from /home/phil/dev/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#4  0x00007f0ccbc6ce1a in WTF::GMainLoopSource::voidSourceCallback(WTF::GMainLoopSource*) () from /home/phil/dev/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#5  0x00007f0cc93127ed in g_main_dispatch (context=0x10ff820) at gmain.c:3064
#6  g_main_context_dispatch (context=context@entry=0x10ff820) at gmain.c:3663
#7  0x00007f0cc9312b88 in g_main_context_iterate (context=0x10ff820, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3734
#8  0x00007f0cc9312ea2 in g_main_loop_run (loop=0x16a0130) at gmain.c:3928
#9  0x00007f0ccdb07771 in WebProcessMainUnix () from /home/phil/dev/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#10 0x00007f0ccbfbdb45 in __libc_start_main (main=0x400730 <main>, argc=2, argv=0x7fffbed03068, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffbed03058)
    at libc-start.c:287
#11 0x0000000000400784 in _start ()
Comment 1 Philippe Normand 2014-11-19 03:52:57 PST
::videoTracks() can indeed return 0 if the video track feature is not enabled at runtime.
Comment 2 Philippe Normand 2014-11-19 04:08:58 PST
Created attachment 241853 [details]
Patch
Comment 3 Philippe Normand 2014-11-19 09:53:41 PST
Committed r176322: <http://trac.webkit.org/changeset/176322>