Last Comment Bug 947994 - createObjectURL incorrect rendering
: createObjectURL incorrect rendering
: testcase-wanted
Product: Core
Classification: Components
Component: DOM (show other bugs)
: 25 Branch
: x86 Windows Vista
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2013-12-09 09:43 PST by Aymeric Vitte
Modified: 2016-03-18 00:44 PDT (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Aymeric Vitte 2013-12-09 09:43:35 PST
User Agent: Mozilla/5.0 (Windows NT 6.0; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131112160018

Steps to reproduce:

Related to 944918 and 945281

Except that following the method has been changed: chunks are stored in IDB as Blobs and concatenated at the end.

I don't know how to produce a reduced test case but this happens for example doing:

load file, store in IDB (initial blob) --> encrypt file, store in IDB --> decrypt file, store in IDB (decrypted blob)

Let's say the file is a mp4 file, doing a.href=document.createObjectURL(decrypted blob) will not display the video, or partially and stop.

a.href=document.createObjectURL(initial blob) works.

I checked that initial blob and decrypted blob are the "same" files (same hash)

Now, refreshing the page and retrying the decrypted blob retrieved from indexedDB will work again.

This new decrypted blob is exactly the decrypted blob above that was stored in indexedDB after concatenation and for which createObjectURL did not render correctly.

So the conclusion seems to be that the concatenated blob is correctly stored in IDB but for some reasons does not render correctly with createObjectURL.

Same tests have been performed with Chrome without any problem.

The issue is still there with Nightly.
Comment 1 User image Aymeric Vitte 2013-12-09 09:46:56 PST
Note: Chrome does not support storing Blobs in indexedDB for now, so ArrayBuffers are stored instead and concatenated as a Blob.
Comment 2 User image Boris Zbarsky [:bz] (still a bit busy) 2013-12-09 10:24:38 PST
Please attach a testcase or post a link to one.
Comment 3 User image Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2013-12-09 10:32:09 PST
Are you trying to reuse the same result from createObjectURL?  The URL is automatically revoked when the page is unloaded (in this case, when you refresh) so the old createObjectURL is no longer valid.  You need to call createObjectURL again with the blob that you just retrieved from indexedDB.
Comment 4 User image Aymeric Vitte 2013-12-10 00:03:26 PST
I will post a link when available or a test case.

Not sure my description was clear:

- slice blob, decrypt chunks, concatenate decrypted chunks = decrypted_blob, store decrypted_blob in IDB (decrypted_blob2)

- createObjectURL(decrypted_blob) --> NOK, incorrect rendering

- save decrypted_blob on the disk, open with video player --> OK

- retrieve decrypted_blob2, createObjectURL(decrypted_blob2) --> OK

Conclusion: only decrypted_blob after chunk concatenation behaves incorrectly
Comment 5 User image Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2013-12-10 04:10:37 PST
Yeah, a link or testcase would be great.
Comment 6 User image Aymeric Vitte 2013-12-20 03:10:43 PST
That's not a test case, neither a link for now, but you can look at the demo video here:

and jump to 12mn 3/4s --> We tried to hide it but if you observe correctly, after opening the video you can see that the video freezes (which does not happen with Chrome as we can see in the video too)
Comment 7 User image Aymeric Vitte 2014-01-23 03:40:06 PST
Still not a reduced test case but you can now see the issue:
Key: 00112233445566778899aabbccddeeff

Download: d5e505e844464056f31cd30e861139dcdc5d2b39

Rename as: collusion.mp4

Open/save: the video starts and gets frozen

Save as collusion.mp4 on your disk

Open from your disk: the video works

Conclusion: createObjectURL incorrect rendering
Comment 8 User image Aymeric Vitte 2014-01-23 03:41:52 PST
I forgot: if you refresh the page and open the video again, this will work.
Comment 9 User image Boris Zbarsky [:bz] (still a bit busy) 2014-01-23 08:43:37 PST
Trying to follow the steps from comment 7.  I load the page.  It prompts for the key.  I put in the key.  It does some "loading" thing.  Then I put the "d5e505e844464056f31cd30e861139dcdc5d2b39" string into the "Enter url or hash name" textbox and click the "Download" button, right?  It pops up some dialog that immediately disappears, then nothing happens...
Comment 10 User image Aymeric Vitte 2014-01-23 08:58:16 PST
Yes, sorry, I gave the wrong reference (the dialog says that the file can not be retrieved), please put: bfee6892dd7a1cc5c167aa00f4d0544fc8549e22, you can let me know by email if there are further problems.
Comment 11 User image Aymeric Vitte 2014-02-28 02:43:00 PST
I suppose it did not work, please try it again, it's more stable now.

Question: can we stream a media right now with createObjectURL? (ie createObjectURL(Blob) augmenting the blob)
Comment 12 User image Cosmin Muntean [:CosminMCG] 2016-02-17 08:25:34 PST
Hi Aymeric,

I have tested this issue with the provided steps from comment 7 on latest Firefox (44.0.2) release, latest Nightly (47.0a1) build and I could not reproduce it. The video played without freezing. I was able to watch the entire video without any problems.

Firefox: 47.0a1, Build ID: 20160216030245
User Agent  Mozilla/5.0 (Windows NT 6.0; rv:47.0) Gecko/20100101 Firefox/47.0
Firefox: 44.0.2, Build ID: 20160210153822
User Agent  Mozilla/5.0 (Windows NT 6.0; rv:47.0) Gecko/20100101 Firefox/44.0

Can you please test this on the latest Firefox release (44.0.2) or latest Nightly (47.0a1, and tell me if this still reproduces for you ? When doing this please use a new fresh Firefox profile, maybe also in safe mode ( 

Comment 13 User image Cosmin Muntean [:CosminMCG] 2016-03-18 00:44:03 PDT

Considering the fact that I cannot reproduce this and the fact that the reporter did not answered to my request until now, I will mark this as Resolved-Worksforme.
If anyone can still reproduce it, feel free to reopen the issue and provide more information.


Note You need to log in before you can comment on or make changes to this bug.