diff options
| author | 2011-02-16 14:54:08 -0800 | |
|---|---|---|
| committer | 2011-02-16 14:54:08 -0800 | |
| commit | 83361072e7d5e66bf1438e413d1b1645a6e13a47 (patch) | |
| tree | 7b0bcb9fb15fc8c9583981e684b26cd0c5dce084 | |
| parent | 6c0dc5a5c1b0b8edd0706f97ed9e8c5d486afdc2 (diff) | |
| parent | 9cfeb6ecfaaee07d17ce9313946518ca6006bc8e (diff) | |
Merge "VideoEditor:Issue ID: 3431967"
| -rwxr-xr-x | media/jni/mediaeditor/VideoEditorPropertiesMain.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp index 014cd95a8812..73a7c9c8a272 100755 --- a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp +++ b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp @@ -122,12 +122,26 @@ jobject videoEditProp_getProperties( &gotten, pEnv, file, NULL, M4OSA_NULL); result = M4OSA_fileReadOpen(&context, (M4OSA_Void*)pFile, M4OSA_kFileRead); + + if(M4NO_ERROR != result) { + // Free the file path. + videoEditOsal_free(pFile); + pFile = M4OSA_NULL; + } + videoEditJava_checkAndThrowIllegalArgumentException(&gotten, pEnv, (M4NO_ERROR != result), "file not found"); - if(M4NO_ERROR != result) - return(properties); - result = M4OSA_fileReadClose(context); - context = M4OSA_NULL; + + // Close the file and free the file context + if (context != NULL) { + result = M4OSA_fileReadClose(context); + context = M4OSA_NULL; + } + + // Return if Error + if (M4NO_ERROR != result) { + return (properties); // NULL + } // Check if the file path is valid. if (gotten) |