mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1057175. If ReadSegments returns a failure code it might not send any data to RasterImage, so check for return value. r=seth
We can hit this if the input stream gets closed before we can read from it. In the case I debugged the image was removed from the DOM (by having it's containing document removed from the DOM) so it's request was cancelled. ReadSegments on a closed stream (at least a cache file input stream) just returns and does nothing.
This commit is contained in:
parent
c01928b7fa
commit
bcdf20a757
@ -1822,8 +1822,9 @@ RasterImage::OnImageDataAvailable(nsIRequest*,
|
||||
uint32_t bytesRead;
|
||||
rv = aInStr->ReadSegments(WriteToRasterImage, this, aCount, &bytesRead);
|
||||
|
||||
NS_ABORT_IF_FALSE(bytesRead == aCount || HasError(),
|
||||
"WriteToRasterImage should consume everything or the image must be in error!");
|
||||
NS_ABORT_IF_FALSE(bytesRead == aCount || HasError() || NS_FAILED(rv),
|
||||
"WriteToRasterImage should consume everything if ReadSegments succeeds or "
|
||||
"the image must be in error!");
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user