Skip to content

Commit

Permalink
Add UTF8 Check to text track serialization
Browse files Browse the repository at this point in the history
Bug: 1316963
Change-Id: I18cf36dfe925c2cae332330d2eb21cedffacc5ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3611234
Reviewed-by: Frank Liberato <liberato@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Auto-Submit: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#997350}
  • Loading branch information
tm-chromium authored and Chromium LUCI CQ committed Apr 28, 2022
1 parent 48f7037 commit e7e5dfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion media/base/media_serializers.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,10 @@ struct MediaSerializer<TextTrackConfig> {
base::Value result(base::Value::Type::DICTIONARY);
FIELD_SERIALIZE("kind", value.kind());
FIELD_SERIALIZE("language", value.language());
if (value.label().length())
if (value.label().length() &&
base::IsStringUTF8AllowingNoncharacters(value.label())) {
FIELD_SERIALIZE("label", value.label());
}
return result;
}
};
Expand Down

0 comments on commit e7e5dfc

Please sign in to comment.