Bug#1021748: mupen64plus: no video (SDL reports an invalid pitch)

Michael Gold michael at bitplane.org
Fri Oct 14 01:41:32 BST 2022


Source: mupen64plus
Version: 2.5+6
Severity: important

Dear Maintainer,

With the most recent mupen64plus package, I no longer see video with any
game.  (A previous version was working.)  The console shows some errors:
	Core: Setting video mode: 960x720
	Core Error: SDL_SetVideoMode failed: Parameter 'pitch' is invalid
	Video Error: Could not set video mode.
	Core: Setting video mode: 960x720
	Core Error: SDL_SetVideoMode failed: Parameter 'pitch' is invalid
	Video Error: Could not set video mode.
	Video Error: Error setting display mode

This bug was already reported and fixed upstream:
https://github.com/mupen64plus/mupen64plus-core/issues/969

In case anyone's looking for a workaround, I've attached some code that
can be built as a shared object and loaded via $LD_PRELOAD.

- Michael


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.19.0-2-amd64 (SMP w/32 CPU threads; PREEMPT)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mupen64plus-audio-all depends on:
ii  mupen64plus-audio-sdl  2.5-5

mupen64plus-audio-all recommends no packages.

mupen64plus-audio-all suggests no packages.

-- no debconf information
-------------- next part --------------
#define _GNU_SOURCE    // make dlfcn.h define RTLD_NEXT
#include <dlfcn.h>
#include <errno.h>
#include <stdio.h>
#include <stdint.h>

struct SDL_Surface*
SDL_CreateRGBSurfaceFrom(void *pixels,
		int width, int height, int depth, int pitch,
		uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask)
{
	static struct SDL_Surface*(*real_fn)(void*, int, int, int, int,
			uint32_t, uint32_t, uint32_t, uint32_t) = NULL;
	if (!pitch) {
		pitch = (depth + 7) / 8 * width;
	}
	if (!real_fn) {
		real_fn = dlsym(RTLD_NEXT, __func__);
		if (!real_fn) {
			errno = ELIBACC;
			return (void*)0;
		}
	}
	return real_fn(pixels, width, height, depth, pitch,
			Rmask, Gmask, Bmask, Amask);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-games-devel/attachments/20221013/efc51aec/attachment.sig>


More information about the Pkg-games-devel mailing list