summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Basavapatna Dattaguru <dattaguru@google.com> 2011-02-16 14:54:08 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-02-16 14:54:08 -0800
commit83361072e7d5e66bf1438e413d1b1645a6e13a47 (patch)
tree7b0bcb9fb15fc8c9583981e684b26cd0c5dce084
parent6c0dc5a5c1b0b8edd0706f97ed9e8c5d486afdc2 (diff)
parent9cfeb6ecfaaee07d17ce9313946518ca6006bc8e (diff)
Merge "VideoEditor:Issue ID: 3431967"
-rwxr-xr-xmedia/jni/mediaeditor/VideoEditorPropertiesMain.cpp22
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)