[Android] Do not try to compute a thumbnail of 0 width or 0 height
Jean-Baptiste Kempf
git at videolan.org
Sun Apr 15 18:40:54 CEST 2012
android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 15 18:34:33 2012 +0200| [f324baea4ff3d09a8f0869be8d0e8760f0bf3801] | committer: Jean-Baptiste Kempf
Do not try to compute a thumbnail of 0 width or 0 height
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=f324baea4ff3d09a8f0869be8d0e8760f0bf3801
---
vlc-android/jni/thumbnailer.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index a4aa194..dbeb30c 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -171,6 +171,13 @@ jbyteArray Java_org_videolan_vlc_LibVLC_getThumbnail(JNIEnv *env, jobject thiz,
goto end;
}
+ /* VLC could not tell us the size */
+ if( videoWidth == 0 || videoHeight == 0 )
+ {
+ LOGE("Could not find correct dimensions.\n");
+ goto end;
+ }
+
/* Compute the size parameters of the frame to generate. */
unsigned picWidth = width;
unsigned picHeight = height;
More information about the Android
mailing list