[examples] clang-tidy in use_media_decoder
A local variable is set in all paths that don't exit(). However,
clang-tidy doesn't appear to interpret this appropriately, so now
we pre-initialize that local var.
This moves garnet/examples/media/ to a state of 0 clang-tidy warnings.
Test: build, CQ, "git-file-tidy --all" is clean in examples/media
Change-Id: Ib9e49d2631de439f540dade8688eee7dc432296f
diff --git a/examples/media/use_media_decoder/use_video_decoder.cc b/examples/media/use_media_decoder/use_video_decoder.cc
index 86d6fa3..5f89821 100644
--- a/examples/media/use_media_decoder/use_video_decoder.cc
+++ b/examples/media/use_media_decoder/use_video_decoder.cc
@@ -151,7 +151,8 @@
}
};
for (size_t i = 0; i < input_size;) {
- size_t start_code_size_bytes;
+ // Until clang-tidy correctly interprets Exit(), this "= 0" satisfies it.
+ size_t start_code_size_bytes = 0;
if (!is_start_code(&input_bytes[i], input_size - i,
&start_code_size_bytes)) {
if (i == 0) {