[Android] Fix ea1869f76ed
Rafaël Carré
git at videolan.org
Mon Jun 17 17:15:16 CEST 2013
vlc-ports/android | branch: master | Rafaël Carré <funman at videolan.org> | Mon Jun 17 17:15:04 2013 +0200| [5f92b3e188861f82e68d44020b3fd59d542e7855] | committer: Rafaël Carré
Fix ea1869f76ed
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=5f92b3e188861f82e68d44020b3fd59d542e7855
---
vlc-android/jni/aout.c | 6 ++++--
vlc-android/jni/thumbnailer.c | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/vlc-android/jni/aout.c b/vlc-android/jni/aout.c
index f2c9569..859509b 100644
--- a/vlc-android/jni/aout.c
+++ b/vlc-android/jni/aout.c
@@ -51,7 +51,7 @@ int aout_open(void **opaque, char *format, unsigned *rate, unsigned *nb_channels
aout_sys_t *p_sys = calloc (1, sizeof (*p_sys));
if (!p_sys)
- return; // OOM
+ goto enomem;
p_sys->j_libVlc = *opaque; // Keep a reference to our Java object
*opaque = (void*) p_sys; // The callback will need aout_sys_t
@@ -63,7 +63,7 @@ int aout_open(void **opaque, char *format, unsigned *rate, unsigned *nb_channels
if ((*myVm)->AttachCurrentThread (myVm, &p_env, NULL) != 0)
{
LOGE("Could not attach the display thread to the JVM !");
- return;
+ goto eattach;
}
// Call the init function.
@@ -121,8 +121,10 @@ int aout_open(void **opaque, char *format, unsigned *rate, unsigned *nb_channels
error:
(*myVm)->DetachCurrentThread (myVm);
+eattach:
*opaque = NULL;
free (p_sys);
+enomem:
return -1;
}
diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index bfdeb1b..2d41a59 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -146,7 +146,7 @@ jbyteArray Java_org_videolan_libvlc_LibVLC_getThumbnail(JNIEnv *env, jobject thi
if (sys == NULL)
{
LOGE("Could not create the thumbnailer data structure!");
- return;
+ goto enomem;
}
/* Initialize the barrier. */
@@ -307,6 +307,6 @@ end:
free(sys->frameData);
free(sys->thumbData);
free(sys);
-
+enomem:
return byteArray;
}
More information about the Android
mailing list