From b19574cea7681b0be553618611143b8370ac7061 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Mon, 18 Jul 2022 15:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=86=85=E5=AD=98=E8=B6=8A?= =?UTF-8?q?=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/amf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Rtmp/amf.cpp b/src/Rtmp/amf.cpp index 5ade9e8b..cb32ae59 100644 --- a/src/Rtmp/amf.cpp +++ b/src/Rtmp/amf.cpp @@ -480,10 +480,10 @@ double AMFDecoder::load() { if (pos + 8 > buf.size()) { throw std::runtime_error("Not enough data"); } - uint64_t val = ((uint64_t) load_be32(&buf[pos]) << 32) - | load_be32(&buf[pos + 4]); + uint64_t val = ((uint64_t) load_be32(&buf[pos]) << 32) | load_be32(&buf[pos + 4]); double n = 0; - memcpy(&n, &val, 8); + static_assert(sizeof(n) == sizeof(val), "sizeof(double) not eq sizeof(uint64_t)"); + memcpy(&n, &val, sizeof(n)); pos += 8; return n;