<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>308414</bug_id>
          
          <creation_ts>2026-02-21 21:42:52 -0800</creation_ts>
          <short_desc>[WebVTT] InbandDataTextTrack::removeCue crashes when removing non-DataCue cues</short_desc>
          <delta_ts>2026-02-22 15:31:09 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>131799</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2183845</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-02-21 21:42:52 -0800</bug_when>
    <thetext>`InbandDataTextTrack::removeCue()` crashes when `TextTrack.removeCue()` is called from JavaScript with a non-DataCue on an inband metadata text track.

Steps to reproduce:
1. Load HLS media with inband metadata track (creates InbandDataTextTrack)
2. JavaScript: `track.addCue(new VTTCue(0, 1, &quot;test&quot;))` (succeeds)
3. JavaScript: `track.removeCue(vttCue)` (crashes)

Crash stack:
```
0  WebCore  WTFCrashWithInfo(int, char const*, char const*, int)   [inlined]
   WebCore  WTF::downcast&lt;DataCue, TextTrackCue&gt;(TextTrackCue&amp;)    [inlined]
   WebCore  InbandDataTextTrack::removeCue(TextTrackCue&amp;)
1  WebCore  jsTextTrackPrototypeFunction_removeCueBody(...)        [inlined]
   WebCore  jsTextTrackPrototypeFunction_removeCue(...)
2  JIT      (JavaScript execution)
[...]
```

Root cause:
The function unconditionally performs `downcast&lt;DataCue&gt;(cue)` which triggers `RELEASE_ASSERT(is&lt;DataCue&gt;(cue))`. However, `TextTrack::addCue()` is non-virtual and allows any TextTrackCue subtype to be added to an `InbandDataTextTrack`, creating this mismatch.

Regression:
This bug has been latent since the original DataCue implementation in April 2014 (commit 150050@main, Bug 131799).

&lt;rdar://122375096&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2183847</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-02-21 22:01:13 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/59190</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2183946</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-02-22 15:31:07 -0800</bug_when>
    <thetext>Committed 308019@main (c9e58f72c198): &lt;https://commits.webkit.org/308019@main&gt;

Reviewed commits have been landed. Closing PR #59190 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>