diff options
author | James Zern <jzern@google.com> | 2020-07-08 13:03:53 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2020-07-08 13:03:53 -0700 |
commit | 11cae244cc06c1295bffa9861c610dcde3b9da18 (patch) | |
tree | 773e0b92a05045d70173dcf2aa2351c1fb1a96d0 | |
parent | 36781965625d57e399e00fc9b60c5d70847391d9 (diff) | |
download | libwebm-11cae244cc06c1295bffa9861c610dcde3b9da18.tar.gz |
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
-rw-r--r-- | webm_info.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ bool OutputSeekHead(const mkvparser::Segment& segment, const Options& options, 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); } |