Skip to content

Commit

Permalink
fix: Fix untrusted types in MediaTailorAdManager
Browse files Browse the repository at this point in the history
  • Loading branch information
theodab committed Dec 6, 2023
1 parent 31c06ca commit d9128a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ads/media_tailor_ad_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,9 @@ shaka.ads.MediaTailorAdManager = class {
if (!app.data.source.length) {
continue;
}
const imageElement = document.createElement('img');
imageElement.setAttribute('src', app.data.source[0].url);
const imageElement = /** @type {!HTMLImageElement} */ (
document.createElement('img'));
imageElement.src = app.data.source[0].url;
imageElement.style.top = (app.placeholder.top || 0) + '%';
imageElement.style.height = (100 - (app.placeholder.top || 0)) + '%';
imageElement.style.left = (app.placeholder.left || 0) + '%';
Expand Down

0 comments on commit d9128a4

Please sign in to comment.