Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: media/webm/webm_parser.cc

Issue 14299005: Add support for zero-padded strings to WebMParser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/webm/webm_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/webm/webm_parser.cc
diff --git a/media/webm/webm_parser.cc b/media/webm/webm_parser.cc
index 9952efa58c701d80814a0bb0ab8f57e84d9cff3f..fd5571e765c1bdbd0a5a265858002a853fcbbd95 100644
--- a/media/webm/webm_parser.cc
+++ b/media/webm/webm_parser.cc
@@ -599,7 +599,8 @@ static int ParseBinary(const uint8* buf, int size, int id,
static int ParseString(const uint8* buf, int size, int id,
WebMParserClient* client) {
- std::string str(reinterpret_cast<const char*>(buf), size);
+ int length = strnlen(reinterpret_cast<const char*>(buf), size);
scherkus (not reviewing) 2013/04/16 21:01:00 fyi compile failure on mac ../../media/webm/webm_
+ std::string str(reinterpret_cast<const char*>(buf), length);
return client->OnString(id, str) ? size : -1;
}
« no previous file with comments | « no previous file | media/webm/webm_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698