Avoid the use of uninitialized variables

This commit is contained in:
Moritz Bunkus 2012-09-01 19:08:10 +02:00
parent fbcf15f5db
commit 0bbeddb627
2 changed files with 2 additions and 2 deletions

View File

@ -682,7 +682,7 @@ parse_arg_display_dimensions(const std::string s,
std::vector<std::string> dims = split(parts[1], "x", 2); std::vector<std::string> dims = split(parts[1], "x", 2);
int64_t id = 0; 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)) 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 <TID>:<width>x<height>, e.g. 1:640x480 (argument was '%1%').\n")) % s); mxerror(boost::format(Y("Display dimensions: not given in the form <TID>:<width>x<height>, e.g. 1:640x480 (argument was '%1%').\n")) % s);

View File

@ -35,7 +35,7 @@ timecode_factory_c::create(const std::string &file_name,
} }
std::string line; 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)) 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")) 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); % file_name);