Bug 1545567 - Ensure ImageOps decode methods can handle unbuffered input streams properly. r=baku
authorAndrew Osmond <aosmond@mozilla.com>
Fri, 26 Apr 2019 09:05:36 -0400
changeset 530444 497afde99626354913b97fdab0abf760aa229cf3
parent 530443 1b18ac7619e30bacc78e01bc154b8627fbfc41b5
child 530445 a1d55f09d0239319f35ab3bfcf29d69d5d7fd7f5
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1545567
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545567 - Ensure ImageOps decode methods can handle unbuffered input streams properly. r=baku Differential Revision: https://phabricator.services.mozilla.com/D28982
image/ImageOps.cpp
--- a/image/ImageOps.cpp
+++ b/image/ImageOps.cpp
@@ -105,16 +105,17 @@ ImageOps::CreateImageBuffer(already_AddR
   // Prepare the input stream.
   if (!NS_InputStreamIsBuffered(inputStream)) {
     nsCOMPtr<nsIInputStream> bufStream;
     rv = NS_NewBufferedInputStream(getter_AddRefs(bufStream),
                                    inputStream.forget(), 1024);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return nullptr;
     }
+    inputStream = std::move(bufStream);
   }
 
   // Figure out how much data we've been passed.
   uint64_t length;
   rv = inputStream->Available(&length);
   if (NS_FAILED(rv) || length > UINT32_MAX) {
     return nullptr;
   }