am 80a058b3: Merge "Do not attempt to decode NULL SkData." into klp-dev

* commit '80a058b3033200835f86ee0e61367a87a470cde8':
  Do not attempt to decode  NULL SkData.
This commit is contained in:
Leon Scroggins III
2013-10-08 06:35:04 -07:00
committed by Android Git Automerger

View File

@@ -514,6 +514,9 @@ static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz, jobject fi
}
SkAutoTUnref<SkData> data(SkData::NewFromFD(descriptor));
if (data.get() == NULL) {
return nullObjectReturn("NewFromFD failed in nativeDecodeFileDescriptor");
}
SkAutoTUnref<SkMemoryStream> stream(new SkMemoryStream(data));
/* Allow purgeable iff we own the FD, i.e., in the puregeable and