diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d0fd0369..e52937c08b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -109,6 +109,7 @@ Bug #6606: Quests with multiple IDs cannot always be restarted Bug #6653: With default settings the in-game console doesn't fit into screen Bug #6655: Constant effect absorb attribute causes the game to break + Bug #6631: Fix ffmpeg avio API usage causing hangs in ffmpeg version 5 Bug #6667: Pressing the Esc key while resting or waiting causes black screen. Bug #6670: Dialogue order is incorrect Bug #6680: object.cpp handles nodetree unsafely, memory access with dangling pointer diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index 0a9641635f..997b4e30c6 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -18,11 +18,14 @@ int FFmpeg_Decoder::readPacket(void *user_data, uint8_t *buf, int buf_size) std::istream& stream = *static_cast(user_data)->mDataStream; stream.clear(); stream.read((char*)buf, buf_size); - return stream.gcount(); + std::streamsize count = stream.gcount(); + if (count == 0) + return AVERROR_EOF; + return count; } catch (std::exception& ) { - return 0; + return AVERROR_UNKNOWN; } }