From 0bbeddb627f5d335590636b82a8505fb6d28044c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 1 Sep 2012 19:08:10 +0200 Subject: [PATCH] Avoid the use of uninitialized variables --- src/merge/mkvmerge.cpp | 2 +- src/merge/timecode_factory.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/merge/mkvmerge.cpp b/src/merge/mkvmerge.cpp index c327832ad..ff1018a74 100644 --- a/src/merge/mkvmerge.cpp +++ b/src/merge/mkvmerge.cpp @@ -682,7 +682,7 @@ parse_arg_display_dimensions(const std::string s, std::vector dims = split(parts[1], "x", 2); int64_t id = 0; - int w, h; + int w = 0, h = 0; if ((dims.size() != 2) || !parse_number(parts[0], id) || !parse_number(dims[0], w) || !parse_number(dims[1], h) || (0 >= w) || (0 >= h)) mxerror(boost::format(Y("Display dimensions: not given in the form :x, e.g. 1:640x480 (argument was '%1%').\n")) % s); diff --git a/src/merge/timecode_factory.cpp b/src/merge/timecode_factory.cpp index f99dd887a..b76f34030 100644 --- a/src/merge/timecode_factory.cpp +++ b/src/merge/timecode_factory.cpp @@ -35,7 +35,7 @@ timecode_factory_c::create(const std::string &file_name, } std::string line; - int version; + int version = -1; if (!in->getline2(line) || !balg::istarts_with(line, "# timecode format v") || !parse_number(&line[strlen("# timecode format v")], version)) mxerror(boost::format(Y("The timecode file '%1%' contains an unsupported/unrecognized format line. The very first line must look like '# timecode format v1'.\n")) % file_name);