[libbluray-devel] Fix shifts

hpi1 git at videolan.org
Sun Feb 21 18:10:52 CET 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Feb 21 19:07:05 2016 +0200| [0d11826d5b631a3f511aad4034269e0703ac9837] | committer: hpi1

Fix shifts

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=0d11826d5b631a3f511aad4034269e0703ac9837
---

 src/libbluray/bdj/native/java_awt_BDGraphics.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/bdj/native/java_awt_BDGraphics.c b/src/libbluray/bdj/native/java_awt_BDGraphics.c
index 1b96254..e228b5d 100644
--- a/src/libbluray/bdj/native/java_awt_BDGraphics.c
+++ b/src/libbluray/bdj/native/java_awt_BDGraphics.c
@@ -67,7 +67,7 @@ Java_java_awt_BDGraphics_drawStringN(JNIEnv * env, jobject obj, jlong ftFace, js
     cls = (*env)->GetObjectClass(env, obj);
     mid = (*env)->GetMethodID(env, cls, "drawPoint", "(III)V");
 
-    a = (rgb >> 24) & 0xff;
+    a = ((unsigned)rgb >> 24) & 0xff;
     c = rgb & 0xffffff;
 
     for (i = 0; i < length; i++) {
@@ -76,7 +76,7 @@ Java_java_awt_BDGraphics_drawStringN(JNIEnv * env, jobject obj, jlong ftFace, js
                 for (k = 0; k < face->glyph->bitmap.width; k++) {
                     jint pixel;
                     pixel = face->glyph->bitmap.buffer[j*face->glyph->bitmap.pitch + k];
-                    pixel = ((a * pixel / 255) << 24) | c;
+                    pixel = ((unsigned)(a * pixel / 255) << 24) | c;
                     (*env)->CallVoidMethod(env, obj, mid,
                                            x + face->glyph->bitmap_left + k,
                                            y - face->glyph->bitmap_top + j,



More information about the libbluray-devel mailing list