<?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>195700</bug_id>
          
          <creation_ts>2019-03-13 14:27:25 -0700</creation_ts>
          <short_desc>Certain videos are causing a crash when used as WebGL texture</short_desc>
          <delta_ts>2019-03-14 12:32:48 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebGL</component>
          <version>Other</version>
          <rep_platform>All</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</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Klaus Reinfeld">mail</reporter>
          <assigned_to name="Jer Noble">jer.noble</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>dino</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jer.noble</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1516159</commentid>
    <comment_count>0</comment_count>
    <who name="Klaus Reinfeld">mail</who>
    <bug_when>2019-03-13 14:27:25 -0700</bug_when>
    <thetext>When using some certain HTML5 videos as WebGL texture the browser-tab instantly crashes.
Tested on latest iOS and Mac Safari versions.

Here a very simple and reduced test-case / example:

https://krpano.com/ios/bugs/webgl-video-texture-crash/

Note - only SOME videos are crashing (provided by users), others are working fine... but I don&apos;t know what is special or different in that crashing videos...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516250</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-03-13 16:41:03 -0700</bug_when>
    <thetext>&lt;rdar://problem/48869347&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516418</commentid>
    <comment_count>2</comment_count>
    <who name="Klaus Reinfeld">mail</who>
    <bug_when>2019-03-13 23:53:51 -0700</bug_when>
    <thetext>Btw - would it be possible to know the reason why only SOME videos are crashing? Is it related to some video-encoding setting?

That could help to allow the customers to change their video-encoding to produce non-crashing videos in the meantime.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516497</commentid>
    <comment_count>3</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2019-03-14 07:48:40 -0700</bug_when>
    <thetext>I suspect this crash has been fixed in ToT but it would be hard to say without an actual crash log.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516520</commentid>
    <comment_count>4</comment_count>
    <who name="Klaus Reinfeld">mail</who>
    <bug_when>2019-03-14 10:09:12 -0700</bug_when>
    <thetext>Sorry, but what is &apos;ToT&apos;?

If you mean Safari Technology Preview - that is crashing too - here its crashlog:

Process:               com.apple.WebKit.WebContent [22358]
Version:               14608 (14608.1.7.3)
Build Info:            WebKit2-7608001007003000~4
Code Type:             X86-64 (Native)
Responsible:           Safari Technology Preview [22270]
Date/Time:             2019-03-14 17:58:45.692 +0100
OS Version:            Mac OS X 10.14.3 (18D109)

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [22358]

Application Specific Information:
*** CFEqual() called with NULL first argument ***
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation      	0x00007fff300af33f CFEqual + 671
1   com.apple.WebCore             	0x000000010c59bb53 WebCore::VideoTextureCopierCV::copyImageToPlatformTexture(__CVBuffer*, unsigned long, unsigned long, unsigned int, unsigned int, int, unsigned int, unsigned int, unsigned int, bool, bool) + 2563
2   com.apple.WebCore             	0x000000010b48ed1c WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture(WebCore::GraphicsContext3D*, unsigned int, unsigned int, int, unsigned int, unsigned int, unsigned int, bool, bool) + 252
3   com.apple.WebCore             	0x000000010c230c69 WebCore::HTMLVideoElement::copyVideoTextureToPlatformTexture(WebCore::GraphicsContext3D*, unsigned int, unsigned int, int, unsigned int, unsigned int, unsigned int, bool, bool) + 169
...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516521</commentid>
    <comment_count>5</comment_count>
    <who name="Klaus Reinfeld">mail</who>
    <bug_when>2019-03-14 10:12:48 -0700</bug_when>
    <thetext>According to this file (not sure if that&apos;s the current version):

https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp

the bug looks like an unhandled/unsupported color transferFunction case...

CVBufferGetAttachment for kCVImageBufferYCbCrMatrixKey seems to return null and the following function doesn&apos;t check for that case...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516522</commentid>
    <comment_count>6</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2019-03-14 10:14:06 -0700</bug_when>
    <thetext>ToT == &quot;tip-of-tree&quot;.

Thanks for the crash log; this looks like a different issue, but one that we&apos;re already tracking. It seems to be the case where the media being displayed isn&apos;t tagged with a particular YUV color matrix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516525</commentid>
    <comment_count>7</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2019-03-14 10:19:07 -0700</bug_when>
    <thetext>&lt;rdar://48605849&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516526</commentid>
    <comment_count>8</comment_count>
      <attachid>364664</attachid>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2019-03-14 10:23:25 -0700</bug_when>
    <thetext>Created attachment 364664
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516541</commentid>
    <comment_count>9</comment_count>
      <attachid>364664</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-03-14 11:22:10 -0700</bug_when>
    <thetext>Comment on attachment 364664
Patch

Clearing flags on attachment: 364664

Committed r242946: &lt;https://trac.webkit.org/changeset/242946&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516542</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-03-14 11:22:11 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516589</commentid>
    <comment_count>11</comment_count>
    <who name="Klaus Reinfeld">mail</who>
    <bug_when>2019-03-14 12:32:48 -0700</bug_when>
    <thetext>Thanks!
If all bugs would be that easy to find and fix ;-).


Btw - a note in the CFEqual documentation that it can&apos;t handle NULL might be also a good idea:

https://developer.apple.com/documentation/corefoundation/1521287-cfequal?language=objc</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>364664</attachid>
            <date>2019-03-14 10:23:25 -0700</date>
            <delta_ts>2019-03-14 11:22:10 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-195700-20190314102324.patch</filename>
            <type>text/plain</type>
            <size>1650</size>
            <attacher name="Jer Noble">jer.noble</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQyOTE1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggNmIyMjA1ZGUyYzY3NzE1
ZjlkOTY5MTkzODFjOTgwMTViOWUxYWM2ZS4uMzE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