[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#716871: marked as done (Sdlevent.MOUSEBUTTONDOWN reports buttons 1-off causing segfaults on wheeldown)



Your message dated Fri, 23 Aug 2024 21:12:25 +0000
with message-id <[🔎] E1shba5-009Odg-Lj@fasolo.debian.org>
and subject line Bug#1078051: Removed package(s) from unstable
has caused the Debian Bug report #716871,
regarding Sdlevent.MOUSEBUTTONDOWN reports buttons 1-off causing segfaults on wheeldown
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
716871: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716871
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: ocamlsdl
Version: 0.9.0-1
Severity: normal
Tags: patch

I noticed that in MOUSEBUTTONDOWN and MOUSEBUTTONUP events the wrong button
is reported. The problem is that SDL starts counting at 1 but the ocaml
type starts at 0. This further causes segfaults when trying to process a
wheel down event since that int is outside the range allowed for mbe_button.

Patch to correct the one-off error attached.

MfG
	Goswin

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash
Description: Fix value_of_mouse_button()
 SDL numbers buttons starting at 1 while the ocaml variant starts at 0.
 This causes the left button to be reported as middle, middle as right
 and so on. Wheeldown finaly returns an invalid value causing segfaults
 on use.
Author: Goswin von Brederlow <goswin-v-b@web.de>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Last-Update: 2013-07-13

---

--- ocamlsdl-0.9.0.orig/src/sdlevent_stub.c
+++ ocamlsdl-0.9.0/src/sdlevent_stub.c
@@ -114,10 +114,10 @@ static value value_of_mouse_button(Uint8
 {
   value r;
   if (SDL_BUTTON_LEFT <= b && b <= SDL_BUTTON_WHEELDOWN)
-    r = Val_int(b);
+    r = Val_int(b - 1);
   else {
     r = caml_alloc_small(1, 0);
-    Field(r, 0) = Val_int(b);
+    Field(r, 0) = Val_int(b - 1);
   }
   return r;
 }

--- End Message ---
--- Begin Message ---
Version: 0.9.1-4+rm

Dear submitter,

as the package ocamlsdl has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1078051

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply to: