Initialize the swizzler if there is a subset
Bug: b/64077740
Change-Id: Ic6bef3f63bcda24fc3d88ce0cdcf1216441faa40
Reviewed-on: https://skia-review.googlesource.com/37680
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
diff --git a/src/codec/SkHeifCodec.cpp b/src/codec/SkHeifCodec.cpp
index 008c129..1067511 100644
--- a/src/codec/SkHeifCodec.cpp
+++ b/src/codec/SkHeifCodec.cpp
@@ -279,6 +279,7 @@
return kInvalidInput;
}
+ fSwizzler.reset(nullptr);
this->allocateStorage(dstInfo);
int rows = this->readRows(dstInfo, dst, dstRowBytes, dstInfo.height(), options);
@@ -355,6 +356,12 @@
return kInvalidInput;
}
+ if (options.fSubset) {
+ this->initializeSwizzler(dstInfo, options);
+ } else {
+ fSwizzler.reset(nullptr);
+ }
+
this->allocateStorage(dstInfo);
return kSuccess;