mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-28 18:17:29 +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;
|
uint32_t bytesRead;
|
||||||
nsresult rv = aInputStream->ReadSegments(AppendToSourceBuffer, this,
|
nsresult rv = aInputStream->ReadSegments(AppendToSourceBuffer, this,
|
||||||
aCount, &bytesRead);
|
aCount, &bytesRead);
|
||||||
if (!NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
MOZ_ASSERT(bytesRead == aCount,
|
return rv;
|
||||||
"AppendToSourceBuffer should consume everything");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue