Merge "Guard against native crash due to null Surface" into pi-dev
am: a98bb36fed
Change-Id: I9cb3e75cdd72592250f755a575c138ecedd3a51b
This commit is contained in:
@@ -1261,6 +1261,11 @@ static void android_media_MediaCodec_setInputSurface(
|
|||||||
sp<PersistentSurface> persistentSurface =
|
sp<PersistentSurface> persistentSurface =
|
||||||
android_media_MediaCodec_getPersistentInputSurface(env, object);
|
android_media_MediaCodec_getPersistentInputSurface(env, object);
|
||||||
|
|
||||||
|
if (persistentSurface == NULL) {
|
||||||
|
throwExceptionAsNecessary(
|
||||||
|
env, BAD_VALUE, ACTION_CODE_FATAL, "input surface not valid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
status_t err = codec->setInputSurface(persistentSurface);
|
status_t err = codec->setInputSurface(persistentSurface);
|
||||||
if (err != NO_ERROR) {
|
if (err != NO_ERROR) {
|
||||||
throwExceptionAsNecessary(env, err);
|
throwExceptionAsNecessary(env, err);
|
||||||
|
|||||||
Reference in New Issue
Block a user