[PATCH 0/1] MR2655: winegstreamer: Fix negative height image size calculation.
Fixes intro video playback in multiple games (e.g. Earth 2150). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2655
From: Anton Baskanov <baskanov(a)gmail.com> Fixes intro video playback in multiple games (e.g. Earth 2150). --- dlls/winegstreamer/quartz_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 590ef48fef4..de62187cd7d 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -286,7 +286,7 @@ unsigned int wg_format_get_max_size(const struct wg_format *format) { case WG_MAJOR_TYPE_VIDEO: { - unsigned int width = format->u.video.width, height = format->u.video.height; + unsigned int width = format->u.video.width, height = abs(format->u.video.height); switch (format->u.video.format) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2655
Might as well use `abs` on both `width` and `height` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2655#note_30174
On Sun Apr 16 10:46:35 2023 +0000, Loïc Rebmeister wrote:
Might as well use `abs` on both `width` and `height` AFAIK `width` is always positive.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2655#note_30175
On Sun Apr 16 10:46:35 2023 +0000, Anton Baskanov wrote:
AFAIK `width` is always positive. Yeah but `height` should always be positive too, and here we are.
You should also check for negative values and add a `FIXME` for debug when either `width` or `height` is negative. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2655#note_30179
On Sun Apr 16 15:16:47 2023 +0000, Loïc Rebmeister wrote:
Yeah but `height` should always be positive too, and here we are. You should also check for negative values and add a `FIXME` for debug when either `width` or `height` is negative. height can be negative (in some cases) to indicate to flip vertically the result of the operation (see WIP in MR 2159, 2471...)
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2655#note_30180
On Sun Apr 16 15:56:06 2023 +0000, eric pouech wrote:
height can be negative (in some cases) to indicate to flip vertically the result of the operation (see WIP in MR 2159, 2471...) Negative height has a special and documented meaning. That's not true of negative width. I suppose we could add a FIXME for that case, but it seems excessively paranoid.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2655#note_30294
This merge request was approved by Zebediah Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2655
participants (5)
-
Anton Baskanov -
Anton Baskanov (@baskanov) -
eric pouech (@epo) -
Loïc Rebmeister -
Zebediah Figura (@zfigura)