Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame buffer can be too small if frame pitch is larger than expected. #8

Closed
JSensebe opened this issue Sep 1, 2024 · 0 comments
Closed

Comments

@JSensebe
Copy link
Contributor

JSensebe commented Sep 1, 2024

Using the Genesis Plus GX core, the pitch can be much larger than the width in pixels times the pixel format width. This leads to an error in ArrayVideoDriver.refresh():

Exception ignored on calling ctypes callback function: <bound method CompositeEnvironmentDriver.video_refresh of <libretro.drivers.environment.composite.CompositeEnvironmentDriver object at 0x000001B5E102DC10>>
Traceback (most recent call last):
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\environment\composite.py", line 332, in video_refresh
    self._video.refresh(view, width, height, pitch)
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\video\multi.py", line 89, in refresh
    self._current.refresh(data, width, height, pitch)
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\video\software\array.py", line 33, in refresh
    frameview[: len(data)] = data
    ~~~~~~~~~^^^^^^^^^^^^^
ValueError: memoryview assignment: lvalue and rvalue have different structures

Reallocating the buffer when it is too small rectifies the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants