diff options
author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-07-21 15:58:03 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-21 22:12:44 +0200 |
commit | 9c71e43c3f8754a5fc2a5410b1c2bf45154d4689 (patch) | |
tree | df0b116a553d076ce3f37de82ed8c3ca56ec6520 /Userland/Libraries | |
parent | f9b7ea6de93c71d387052192773641c414718365 (diff) | |
download | serenity-9c71e43c3f8754a5fc2a5410b1c2bf45154d4689.zip |
LibAudio: Check if zero-bit padding is actually zero
This might allow the program to return an error a bit quicker.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibAudio/FlacLoader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibAudio/FlacLoader.cpp b/Userland/Libraries/LibAudio/FlacLoader.cpp index 7110d77e2b..86e12e380c 100644 --- a/Userland/Libraries/LibAudio/FlacLoader.cpp +++ b/Userland/Libraries/LibAudio/FlacLoader.cpp @@ -512,7 +512,10 @@ FlacSubframeHeader FlacLoaderPlugin::next_subframe_header(InputBitStream& bit_st } // zero-bit padding - bit_stream.read_bit_big_endian(); + if (bit_stream.read_bit_big_endian() != 0) { + m_error_string = "Zero bit padding"; + return {}; + }; // subframe type (encoding) u8 subframe_code = bit_stream.read_bits_big_endian(6); |