mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Make Sourcebuffer::AppendFromInputStream handle canceled image loads.
This commit is contained in:
parent
f84fdea422
commit
3640321580
1 changed files with 11 additions and 3 deletions
|
|
@ -451,10 +451,18 @@ SourceBuffer::AppendFromInputStream(nsIInputStream* aInputStream,
|
|||
uint32_t bytesRead;
|
||||
nsresult rv = aInputStream->ReadSegments(AppendToSourceBuffer, this,
|
||||
aCount, &bytesRead);
|
||||
if (!NS_WARN_IF(NS_FAILED(rv))) {
|
||||
MOZ_ASSERT(bytesRead == aCount,
|
||||
"AppendToSourceBuffer should consume everything");
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (bytesRead == 0) {
|
||||
// The loading of the image has been canceled.
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(bytesRead == aCount,
|
||||
"AppendToSourceBuffer should consume everything");
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue