зеркало из https://github.com/mozilla/pjs.git
Bug 583205 - Crash at the time of download completion. r=karlt,a=blocker
This commit is contained in:
Родитель
42e8da7d27
Коммит
f207e2e08d
|
@ -69,9 +69,21 @@ GdkPixbuf*
|
|||
nsImageToPixbuf::ImageToPixbuf(imgIContainer* aImage)
|
||||
{
|
||||
nsRefPtr<gfxImageSurface> frame;
|
||||
aImage->CopyFrame(imgIContainer::FRAME_CURRENT,
|
||||
imgIContainer::FLAG_SYNC_DECODE,
|
||||
getter_AddRefs(frame));
|
||||
nsresult rv = aImage->CopyFrame(imgIContainer::FRAME_CURRENT,
|
||||
imgIContainer::FLAG_SYNC_DECODE,
|
||||
getter_AddRefs(frame));
|
||||
|
||||
// If the last call failed, it was probably because our call stack originates
|
||||
// in an imgIDecoderObserver event, meaning that we're not allowed request
|
||||
// a sync decode. Presumably the originating event is something sensible like
|
||||
// OnStopFrame(), so we can just retry the call without a sync decode.
|
||||
if (NS_FAILED(rv))
|
||||
aImage->CopyFrame(imgIContainer::FRAME_CURRENT,
|
||||
imgIContainer::FLAG_NONE,
|
||||
getter_AddRefs(frame));
|
||||
|
||||
if (!frame)
|
||||
return nsnull;
|
||||
|
||||
return ImgSurfaceToPixbuf(frame, frame->Width(), frame->Height());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче