webm_info: fix clang -Wdangling-gsl warning
This warning detects when pointers are owned by an object, but that
object is deleted at the end of a statement. Since the pointer is to
freed memory, accessing the pointer may produce unexpected results.
BUG=webm:1698
Change-Id: I200508e23b2bdafadbbfe535de0906739503f6ad
diff --git a/webm_info.cc b/webm_info.cc
index 7f2cb6f..fdf4759 100644
--- a/webm_info.cc
+++ b/webm_info.cc
@@ -243,11 +243,11 @@
fprintf(o, "\n");
indent->Adjust(libwebm::kIncreaseIndent);
- const char* const entry_indent = indent->indent_str().c_str();
+ std::string entry_indent = indent->indent_str();
// TODO(jzern): 1) known ids could be stringified. 2) ids could be
// reencoded to EBML for ease of lookup.
- fprintf(o, "%sSeek ID : %llx\n", entry_indent, entry->id);
- fprintf(o, "%sSeek position : %lld\n", entry_indent, entry->pos);
+ fprintf(o, "%sSeek ID : %llx\n", entry_indent.c_str(), entry->id);
+ fprintf(o, "%sSeek position : %lld\n", entry_indent.c_str(), entry->pos);
indent->Adjust(libwebm::kDecreaseIndent);
}