Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 27b254f

Browse files
jianjunzzmodem
andauthored
Fix incorrect use of scoped enumerations in format strings (#203)
Scoped enums do not get automatically promoted to their underlying type, so these uses have undefined behavior and Clang recently started warning about it. Bug: chromium:1456289 Change-Id: I9cf4e5a68378930a3bf7d8ac7b0a21eaf0d12670 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309520 Reviewed-by: Rasmus Brandt <[email protected]> Auto-Submit: Hans Wennborg <[email protected]> Commit-Queue: Rasmus Brandt <[email protected]> Cr-Commit-Position: refs/heads/main@{#40321} Co-authored-by: Hans Wennborg <[email protected]>
1 parent 49d511c commit 27b254f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/video_codecs/h264_profile_level_id.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ absl::optional<std::string> H264ProfileLevelIdToString(
238238
}
239239

240240
char str[7];
241-
snprintf(str, 7u, "%s%02x", profile_idc_iop_string, profile_level_id.level);
241+
snprintf(str, 7u, "%s%02x", profile_idc_iop_string,
242+
static_cast<unsigned>(profile_level_id.level));
242243
return {str};
243244
}
244245

0 commit comments

Comments
 (0)