From 7a3073423ec82c49fd59ce8209c56182846a8c6c Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Sun, 25 Sep 2022 12:36:07 -0700 Subject: [PATCH] #651: speculative followup patch --- dom/canvas/CanvasRenderingContext2D.cpp | 4 ++-- modules/libjar/nsJARChannel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 9b76c0afa..a68e5925c 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -5500,8 +5500,8 @@ CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w return NS_ERROR_FAILURE; } - uint32_t copyX = dirtyRect.x; - uint32_t copyY = dirtyRect.y; + uint32_t copyX = dirtyRect.x - x; + uint32_t copyY = dirtyRect.y - y; //uint8_t *src = aArray->Data(); uint8_t *dst = imgsurf->Data(); uint8_t* srcLine = aArray->Data() + copyY * (w * 4) + copyX * 4; diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index c4cd74fa0..b34db6d1c 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -714,7 +714,7 @@ nsJARChannel::GetSecurityInfo(nsISupports **aSecurityInfo) return NS_OK; } -NS_IMETHODIMP +nsresult nsJARChannel::SetContentTypeGuess() { // // generate content type and set it @@ -752,7 +752,7 @@ nsJARChannel::GetContentType(nsACString &aResult) { // If the Jar file has not been open yet, // We return application/x-unknown-content-type - if (!mOpened || mContentType.IsEmpty()) { + if (!mOpened && mContentType.IsEmpty()) { aResult.Assign(UNKNOWN_CONTENT_TYPE); return NS_OK; }