1
0
forked from mirrors/0ad

Skip playing audio of corrupted files.

Prints a warning instead of crashing.

Fixes #7150

(cherry picked from commit a81c38bab9)
Signed-off-by: Itms <itms@wildfiregames.com>
This commit is contained in:
scuti
2024-12-17 16:38:23 -08:00
committed by Itms
parent 2b8a4fabcf
commit 99ebeeb39b
2 changed files with 14 additions and 3 deletions
@@ -264,6 +264,7 @@
{ "nick": "sbirmi", "name": "Sharad Birmiwal" },
{ "nick": "sbte", "name": "Sven Baars" },
{ "nick": "scroogie", "name": "André Gemünd" },
{ "nick": "scuti" },
{ "nick": "scythetwirler", "name": "Casey X." },
{ "nick": "sera", "name": "Ralph Sennhauser" },
{ "nick": "Serihilda" },
+13 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -236,8 +236,18 @@ public:
callbacks.seek_func = Adapter::Seek;
callbacks.tell_func = Adapter::Tell;
const int ret = ov_open_callbacks(&adapter, &vf, 0, 0, callbacks);
if(ret != 0)
WARN_RETURN(LibErrorFromVorbis(ret));
switch (ret)
{
case 0:
break;
case OV_EBADHEADER:
case OV_EREAD:
case OV_ENOTVORBIS:
case OV_EVERSION:
return LibErrorFromVorbis(ret);
default:
WARN_RETURN(LibErrorFromVorbis(ret));
}
const int link = -1; // retrieve info for current bitstream
info = ov_info(&vf, link);