Commit b0716a7f authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

bindings: Check if a dictionary member is not missing before accessing

This CL adds checking if |config->profile| is available before
accessing it.

Bug: 839389
Change-Id: I92214e32575f86c899c4a6fc3aeea189877118d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358941
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798553}
parent f06f40db
......@@ -289,7 +289,9 @@ void VideoEncoder::ProcessConfigure(Request* request) {
}
std::string codec_str = config->codec().Utf8();
std::string profile_str = config->profile().Utf8();
std::string profile_str;
if (config->hasProfile())
profile_str = config->profile().Utf8();
auto codec_type = media::StringToVideoCodec(codec_str);
if (codec_type == media::kUnknownVideoCodec) {
HandleError(DOMExceptionCode::kNotFoundError, "Unknown codec type");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment