createObjectURL incorrect rendering




5 years ago
9 days ago


(Reporter: avitte, Unassigned)



25 Branch
Windows Vista

Firefox Tracking Flags

(Not tracked)




5 years ago
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

5 years ago
Note: Chrome does not support storing Blobs in indexedDB for now, so ArrayBuffers are stored instead and concatenated as a Blob.
Component: Untriaged → Web Apps
Please attach a testcase or post a link to one.
Component: Web Apps → DOM
Product: Firefox → Core
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

5 years ago
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
Yeah, a link or testcase would be great.
Keywords: testcase-wanted

Comment 6

5 years ago
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

5 years ago
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

5 years ago
I forgot: if you refresh the page and open the video again, this will work.
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

5 years ago
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

5 years ago
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)
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 ( 

Flags: needinfo?(avitte)

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.

Last Resolved: 3 years ago
Flags: needinfo?(avitte)
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.