Github messages for voidlinux
 help / color / mirror / Atom feed
From: dexgs <dexgs@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] mupen64plus: Fix crash due to SDL_SetVideoMode in SDL 2 compatibility code
Date: Fri, 21 Oct 2022 02:44:09 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40073@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

There is a new pull request by dexgs against master on the void-packages repository

https://github.com/dexgs/void-packages mupen64plus
https://github.com/void-linux/void-packages/pull/40073

mupen64plus: Fix crash due to SDL_SetVideoMode in SDL 2 compatibility code
Add a patch which applies the change from https://github.com/mupen64plus/mupen64plus-core/pull/970 so that mupen64plus still works after updating to SDL 2.24

The patch should be removed after the next release of mupen64plus since the fix will already be included.

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)


A patch file from https://github.com/void-linux/void-packages/pull/40073.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mupen64plus-40073.patch --]
[-- Type: text/x-diff, Size: 3057 bytes --]

From e7d279e75a29cf735395b3b286000d7e2804cb7e Mon Sep 17 00:00:00 2001
From: Dexter Gaon-Shatford <dexter.gaonshatford@gmail.com>
Date: Thu, 20 Oct 2022 20:40:16 -0400
Subject: [PATCH] mupen64plus: Fix crash due to SDL_SetVideoMode in SDL 2
 compatibility code.

Add a patch which applies the change from
https://github.com/mupen64plus/mupen64plus-core/pull/970 so that
mupen64plus still works after updating to SDL 2.24

The patch should be removed after the next release of mupen64plus since
the fix will already be included.
---
 ...argument-in-call-to-SDL_CreateRGBSur.patch | 34 +++++++++++++++++++
 srcpkgs/mupen64plus/template                  |  2 +-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mupen64plus/patches/0001-Fix-wrong-pitch-argument-in-call-to-SDL_CreateRGBSur.patch

diff --git a/srcpkgs/mupen64plus/patches/0001-Fix-wrong-pitch-argument-in-call-to-SDL_CreateRGBSur.patch b/srcpkgs/mupen64plus/patches/0001-Fix-wrong-pitch-argument-in-call-to-SDL_CreateRGBSur.patch
new file mode 100644
index 000000000000..2e37d55c404d
--- /dev/null
+++ b/srcpkgs/mupen64plus/patches/0001-Fix-wrong-pitch-argument-in-call-to-SDL_CreateRGBSur.patch
@@ -0,0 +1,34 @@
+From 9d016ace855b88916746837b1a424cf9e5960c3b Mon Sep 17 00:00:00 2001
+From: Dexter Gaon-Shatford <dexter@gaonshatford.ca>
+Date: Thu, 20 Oct 2022 20:06:16 -0400
+Subject: [PATCH] Fix wrong pitch argument in call to SDL_CreateRGBSurfaceFrom.
+
+This patch makes the change in
+https://github.com/mupen64plus/mupen64plus-core/pull/970 compatible with
+the source distribution of mupen64plus v2.5.9.
+
+This patch should be removed when the next version of mupen64plus is
+released since it will already contain the changes from the PR mentioned
+above.
+---
+ src/api/vidext_sdl2_compat.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/source/mupen64plus-core/src/api/vidext_sdl2_compat.h b/source/mupen64plus-core/src/api/vidext_sdl2_compat.h
+index 06d778dd..7cbd5963 100644
+--- a/source/mupen64plus-core/src/api/vidext_sdl2_compat.h
++++ b/source/mupen64plus-core/src/api/vidext_sdl2_compat.h
+@@ -474,8 +474,9 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
+         if (SDL_GL_MakeCurrent(SDL_VideoWindow, SDL_VideoContext) < 0) {
+             return NULL;
+         }
++        int pitch = (bpp + 7) / 8 * width;
+         SDL_VideoSurface =
+-            SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, 0, 0, 0, 0, 0);
++            SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, pitch, 0, 0, 0, 0);
+         if (!SDL_VideoSurface) {
+             return NULL;
+         }
+-- 
+2.38.1
+
diff --git a/srcpkgs/mupen64plus/template b/srcpkgs/mupen64plus/template
index f4a58a4749cb..810b97c78311 100644
--- a/srcpkgs/mupen64plus/template
+++ b/srcpkgs/mupen64plus/template
@@ -1,7 +1,7 @@
 # Template file for 'mupen64plus'
 pkgname=mupen64plus
 version=2.5.9
-revision=2
+revision=3
 archs="x86_64* i686*"
 wrksrc="mupen64plus-bundle-src-${version}"
 hostmakedepends="pkg-config which nasm"

             reply	other threads:[~2022-10-21  0:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21  0:44 dexgs [this message]
2022-10-22 23:01 ` [PR PATCH] [Merged]: " Johnnynator

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40073@inbox.vuxu.org \
    --to=dexgs@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).