Fix field packer bug for U32 data.
Fix initial refcounts in allocations.
Support null references in allocations.

Change-Id: Ifba6406ba750e69737bd77fa7df5d7fb8e27a5b4
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 7d31bd6..7e44fea 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -34,6 +34,9 @@
     init(rsc, type);
 
     mPtr = malloc(mType->getSizeBytes());
+    if (mType->getElement()->getHasReferences()) {
+        memset(mPtr, 0, mType->getSizeBytes());
+    }
     if (!mPtr) {
         LOGE("Allocation::Allocation, alloc failure");
     }