mf_media_type_from_wg_format() may return NULL.
Fix Airborne Kingdom crash at start because WG_AUDIO_FORMAT_UNKNOWN is passed to mf_media_type_from_wg_format().
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
-- v2: winegstreamer: Trace mf_media_type_from_wg_format_{audio|video}(). winegstreamer: Always check the return value from mf_media_type_from_wg_format().
From: Zhiyi Zhang zzhang@codeweavers.com
mf_media_type_from_wg_format() may return NULL.
Fix Airborne Kingdom crash at start because WG_AUDIO_FORMAT_UNKNOWN is passed to mf_media_type_from_wg_format().
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/winegstreamer/media_source.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index f07b83f413e..43beb71838a 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -879,6 +879,12 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) IMFMediaType *base_type = mf_media_type_from_wg_format(&format); GUID base_subtype;
+ if (!base_type) + { + hr = MF_E_INVALIDMEDIATYPE; + goto done; + } + IMFMediaType_GetGUID(base_type, &MF_MT_SUBTYPE, &base_subtype);
stream_types[0] = base_type; @@ -911,8 +917,8 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) WG_AUDIO_FORMAT_F32LE, };
- stream_types[0] = mf_media_type_from_wg_format(&format); - type_count = 1; + if ((stream_types[0] = mf_media_type_from_wg_format(&format))) + type_count = 1;
for (i = 0; i < ARRAY_SIZE(audio_types); i++) { @@ -921,7 +927,8 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) continue; new_format = format; new_format.u.audio.format = audio_types[i]; - stream_types[type_count++] = mf_media_type_from_wg_format(&new_format); + if ((stream_types[type_count] = mf_media_type_from_wg_format(&new_format))) + type_count++; } } else
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/winegstreamer/mfplat.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 55f9ae6323d..d6620c0d08a 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -435,6 +435,7 @@ static IMFMediaType *mf_media_type_from_wg_format_audio(const struct wg_format * } }
+ FIXME("Unknown audio format %#x.\n", format->u.audio.format); return NULL; }
@@ -478,6 +479,7 @@ static IMFMediaType *mf_media_type_from_wg_format_video(const struct wg_format * } }
+ FIXME("Unknown video format %#x.\n", format->u.video.format); return NULL; }
This patch is probably a good idea regardless, but it also leads me to ask: what format does the file actually have, and should we translate that into Win32 type information?
I don't know. The music plays properly after this patch though. I didn't find the audio file on disk so it's probably generated.
On 8/10/22 02:16, Zhiyi Zhang (@zhiyi) wrote:
This patch is probably a good idea regardless, but it also leads me to ask: what format does the file actually have, and should we translate that into Win32 type information?
I don't know. The music plays properly after this patch though. I didn't find the audio file on disk so it's probably generated.
FWIW, you can probably find out from a log with GST_DEBUG=wine:4.
On Wed Aug 10 17:24:39 2022 +0000, **** wrote:
Zebediah Figura (she/her) replied on the mailing list:
On 8/10/22 02:16, Zhiyi Zhang (@zhiyi) wrote: >> This patch is probably a good idea regardless, but it also leads me to >> ask: what format does the file actually have, and should we translate >> that into Win32 type information? > > I don't know. The music plays properly after this patch though. I didn't find the audio file on disk so it's probably generated. > FWIW, you can probably find out from a log with GST_DEBUG=wine:4. _______________________________________________ wine-gitlab mailing list -- wine-gitlab@winehq.org To unsubscribe send an email to wine-gitlab-leave@winehq.org
"qtdemux qtdemux.c:12570:qtdemux_parse_trak:<qtdemux0>[00m type lpcm caps audio/x-raw, format=(string)S16BE, layout=(string)interleaved". So it's S16BE. Full proton wine log with "GST_DEBUG": "4,WINE:4" is at https://pastebin.com/Z44MncVp
This merge request was approved by Zebediah Figura.