Merge cherrypicks of [2775115, 2774970, 2775080, 2774971, 2775063, 2775066, 2775357, 2775358, 2774351, 2774352, 2774797, 2774798, 2775359, 2775360, 2775361, 2775362, 2775363, 2774972, 2774973, 2774974, 2774975, 2774976, 2774977, 2774978, 2775397, 2774353, 2774354, 2774355, 2774907] into oc-release

Change-Id: If0b52bacdd9c619f4e145af23360c89902547b4c
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 88a5bd4..2305206 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2682,7 +2682,7 @@
         // for in the transform. We need to mirror this scaling in child surfaces
         // or we will break the contract where WM can treat child surfaces as
         // pixels in the parent surface.
-        if (p->isFixedSize()) {
+        if (p->isFixedSize() && p->mActiveBuffer != nullptr) {
             int bufferWidth;
             int bufferHeight;
             if ((p->mCurrentTransform & NATIVE_WINDOW_TRANSFORM_ROT_90) == 0) {