File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,6 +249,17 @@ std::string AdaptiveBase64Util::Encode(const std::vector<char>& decodedBase64)
249249// Format for DataURI is data:[<MediaType>][;base64],data with MediaType and base64 being optional and data is composed of [A-Z a-z 0-9 + /] characters
250250std::string AdaptiveBase64Util::ExtractDataFromUri (const std::string& dataUri)
251251{
252- size_t comaPosition = dataUri.find_last_of (" ," );
253- return dataUri.substr (comaPosition + 1 );
252+ size_t commaPosition = dataUri.find_last_of (" ," );
253+ if (commaPosition != std::string::npos)
254+ {
255+ size_t startPosition = std::find_if_not (
256+ dataUri.begin () + commaPosition + 1 ,
257+ dataUri.end (),
258+ [](char c) { return std::isspace (c); }
259+ ) - dataUri.begin ();
260+
261+ return dataUri.substr (startPosition);
262+ }
263+
264+ return {};
254265}
Original file line number Diff line number Diff line change @@ -397,14 +397,13 @@ namespace AdaptiveCards::Rendering::Xaml_Rendering
397397 svgImageSource.RasterizePixelHeight (size.Height );
398398 svgImageSource.RasterizePixelWidth (size.Width );
399399 }
400-
401- co_await svgImageSource.SetSourceAsync (stream);
400+ svgImageSource.SetSourceAsync (stream);
402401 }
403402 else
404403 {
405404 co_await wil::resume_foreground (GetDispatcher (strongImageSource));
406405 auto bitmapImage = strongImageSource.as <winrt::BitmapImage>();
407- co_await bitmapImage.SetSourceAsync (stream);
406+ bitmapImage.SetSourceAsync (stream);
408407 }
409408 }
410409 else
You can’t perform that action at this time.
0 commit comments