From 021432be9d66e29bce6174dbc6689ccc60628309 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Fri, 11 Dec 2015 11:23:53 -0800 Subject: [PATCH] webm2pes: Fix the linux build. - Fix narrowing warnings in BCMVHeader::Write - Add missing include for std::memcpy (cstring). BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1113 Change-Id: I5e89a5d4f30c9925fc6110502dc927172c709c03 --- webm2pes.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/webm2pes.cc b/webm2pes.cc index b90b87c..8a2f966 100644 --- a/webm2pes.cc +++ b/webm2pes.cc @@ -7,6 +7,7 @@ // be found in the AUTHORS file in the root of the source tree. #include "webm2pes.h" +#include #include namespace { @@ -258,12 +259,13 @@ bool BCMVHeader::Write(std::FILE* fileptr) const { std::fprintf(stderr, "Webm2Pes: BCMV write failed.\n"); } const std::size_t kRemainingBytes = 6; - const uint8_t buffer[kRemainingBytes] = {(length >> 24) & 0xff, - (length >> 16) & 0xff, - (length >> 8) & 0xff, - length & 0xff, - 0, - 0 /* 2 bytes 0 padding */}; + const uint8_t buffer[kRemainingBytes] = { + static_cast((length >> 24) & 0xff), + static_cast((length >> 16) & 0xff), + static_cast((length >> 8) & 0xff), + static_cast(length & 0xff), + 0, + 0 /* 2 bytes 0 padding */}; for (std::int8_t i = 0; i < kRemainingBytes; ++i) { if (WriteUint8(buffer[i], fileptr) != true) { std::fprintf(stderr, "Webm2Pes: BCMV remainder write failed.\n");