From c3d393f214181f8f5fed29f8192bdcd9223ba50f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Apr 2022 21:03:18 +0200 Subject: [PATCH] tag/Id3Picture: fix unaligned access --- src/tag/Id3Picture.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tag/Id3Picture.cxx b/src/tag/Id3Picture.cxx index a72e6a63b..fc2ba08f5 100644 --- a/src/tag/Id3Picture.cxx +++ b/src/tag/Id3Picture.cxx @@ -32,7 +32,7 @@ ReadString(ConstBuffer &src) noexcept if (src.size < 4) return nullptr; - const size_t length = FromBE32(*(const uint32_t *)src.data); + const size_t length = *(const PackedBE32 *)src.data; src.skip_front(4); if (src.size < length) @@ -65,7 +65,7 @@ ScanId3Apic(ConstBuffer _buffer, TagHandler &handler) noexcept buffer.skip_front(16); - const size_t image_size = FromBE32(*(const uint32_t *)buffer.data); + const size_t image_size = *(const PackedBE32 *)buffer.data; buffer.skip_front(4); if (buffer.size < image_size)