Continue error check improvements and write some docs.

Change-Id: I345b08490da21d9ee715ff1ddc80c1a816b579f4
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index b74fa8e..28078fc 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -869,6 +869,8 @@
         }
     } else {
         rsc->setError(RS_ERROR_BAD_VALUE, "Unsupported bitmap format");
+        delete texAlloc;
+        return NULL;
     }
 
     return texAlloc;