aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skiaserve
diff options
context:
space:
mode:
Diffstat (limited to 'tools/skiaserve')
-rw-r--r--tools/skiaserve/urlhandlers/PostHandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/skiaserve/urlhandlers/PostHandler.cpp b/tools/skiaserve/urlhandlers/PostHandler.cpp
index 34beefae11..634a2e5da2 100644
--- a/tools/skiaserve/urlhandlers/PostHandler.cpp
+++ b/tools/skiaserve/urlhandlers/PostHandler.cpp
@@ -62,7 +62,8 @@ int PostHandler::handle(Request* request, MHD_Connection* connection,
MHD_destroy_post_processor(uc->fPostProcessor);
uc->fPostProcessor = nullptr;
- if (!request->initPictureFromStream(request->fUploadContext->fStream.detachAsStream())) {
+ std::unique_ptr<SkStreamAsset> stream(request->fUploadContext->fStream.detachAsStream());
+ if (!request->initPictureFromStream(stream.get())) {
fprintf(stderr, "Could not create picture from stream.\n");
return MHD_NO;
}