diff options
author | Rajneesh Chowdury <rajneeshc@google.com> | 2011-03-15 16:20:17 -0700 |
---|---|---|
committer | Rajneesh Chowdury <rajneeshc@google.com> | 2011-03-15 16:20:17 -0700 |
commit | 8e7991a52edb3eb8bd1a44ceb7f6d97108748c8c (patch) | |
tree | 66b4f142e7368d3bd08590b12c0d1d8e4823d012 /media/jni/mediaeditor | |
parent | 3ec9d06f070db3a8899ad235736abd0ffaf6f578 (diff) | |
download | frameworks_base-8e7991a52edb3eb8bd1a44ceb7f6d97108748c8c.zip frameworks_base-8e7991a52edb3eb8bd1a44ceb7f6d97108748c8c.tar.gz frameworks_base-8e7991a52edb3eb8bd1a44ceb7f6d97108748c8c.tar.bz2 |
Fix for 4087846 Crash reported by monkey report (Java/Jni)
Change-Id: I356f975743f5a24e72f33a20ee497a2b12791be6
Diffstat (limited to 'media/jni/mediaeditor')
-rwxr-xr-x | media/jni/mediaeditor/VideoEditorMain.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp index 8cda14e..11e2a5e 100755 --- a/media/jni/mediaeditor/VideoEditorMain.cpp +++ b/media/jni/mediaeditor/VideoEditorMain.cpp @@ -557,6 +557,10 @@ static void videoEditor_clearSurface(JNIEnv* pEnv, Surface* const p = (Surface*)pEnv->GetIntField(surface, surface_native); sp<Surface> previewSurface = sp<Surface>(p); + // Validate the mSurface's mNativeSurface field + videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv, + (NULL == previewSurface.get()), + "mNativeSurface is null"); frameStr.pBuffer = M4OSA_NULL; frameStr.timeMs = 0; @@ -634,6 +638,10 @@ static int videoEditor_renderPreviewFrame(JNIEnv* pEnv, Surface* const p = (Surface*)pEnv->GetIntField(mSurface, surface_native); sp<Surface> previewSurface = sp<Surface>(p); + // Validate the mSurface's mNativeSurface field + videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv, + (NULL == previewSurface.get()), + "mNativeSurface is null"); /* Determine the total number of clips, total duration*/ uiNumberOfClipsInStoryBoard = pContext->pEditSettings->uiClipNumber; @@ -2058,6 +2066,10 @@ videoEditor_startPreview( Surface* const p = (Surface*)pEnv->GetIntField(mSurface, surface_native); sp<Surface> previewSurface = sp<Surface>(p); + // Validate the mSurface's mNativeSurface field + videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv, + (NULL == previewSurface.get()), + "mNativeSurface is null"); result = pContext->mPreviewController->setSurface(previewSurface); videoEditJava_checkAndThrowRuntimeException(&needToBeLoaded, pEnv, |