Bug 847559 - Handle writes to a size-only JPEG decoder after we've gotten the size. r=seth

--HG--
extra : rebase_source : c02aa4f03dbba90d07f55d383a507bb27f605287
This commit is contained in:
Joe Drew 2013-02-27 14:23:08 -05:00
parent 7a3348f6ce
commit 181d2fdae5

View File

@ -194,6 +194,11 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
NS_ABORT_IF_FALSE(!HasError(), "Shouldn't call WriteInternal after error!");
if (IsSizeDecode() && HasSize()) {
// More data came in since we found the size. We have nothing to do here.
return;
}
/* Return here if there is a fatal error within libjpeg. */
nsresult error_code;
// This cast to nsresult makes sense because setjmp() returns whatever we