Bug 1072539 - Only ForceDiscard() in imgFrame::GetFrame() if it's safe to do so. r=tn

This commit is contained in:
Seth Fowler 2014-09-24 14:26:13 -07:00
parent 91bc96aa11
commit 6f0ecafaa2

View File

@ -612,8 +612,10 @@ RasterImage::GetFrame(uint32_t aFrameNum)
if (!ref) {
// The OS threw this frame away. We need to discard and redecode.
MOZ_ASSERT(!mAnim, "Animated frames should be locked");
ForceDiscard();
WantDecodedFrames();
if (CanForciblyDiscardAndRedecode()) {
ForceDiscard();
WantDecodedFrames();
}
return DrawableFrameRef();
}