Commit f1bf1c82 authored by Rakesh Soma's avatar Rakesh Soma Committed by Commit Bot

Fix the resolution issue with picture url. Fallback to default url,

if individual resolution url parsing fails.

Bug: 1140575
Change-Id: Iebe612418486a2650632f0861c2622a426b65e9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2487825
Commit-Queue: Rakesh Soma <rakeshsoma@google.com>
Reviewed-by: default avatarYusuf Sengul <yusufsn@google.com>
Cr-Commit-Position: refs/heads/master@{#819193}
parent 4d02c8d1
......@@ -327,8 +327,15 @@ HRESULT UpdateProfilePicturesForWindows8AndNewer(
continue;
}
std::string current_picture_url =
base::UTF16ToUTF8(picture_url) + base::StringPrintf("=s%i", image_size);
std::size_t found = base::UTF16ToUTF8(picture_url).rfind("=s");
std::string current_picture_url;
if (found != std::string::npos)
current_picture_url = base::UTF16ToUTF8(picture_url).substr(0, found) +
base::StringPrintf("=s%i", image_size);
else
// Fallback to default picture url if parsing fails.
current_picture_url = base::UTF16ToUTF8(picture_url) +
base::StringPrintf("=s%i", image_size);
auto fetcher = WinHttpUrlFetcher::Create(GURL(current_picture_url));
if (!fetcher) {
......
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