Skip to content

Commit

Permalink
fix invalid video poster image loading from panicking (#31447)
Browse files Browse the repository at this point in the history
This fixed #31438. When an image is loaded from cache, it will
load a placeholder if the url is not a valid image url. This
may be unexpected when using the image cache and specifying
UsePlaceholder::No but that has no effect on loading an image
not in the cache.

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
  • Loading branch information
sebsebmc committed Feb 28, 2024
1 parent e2e30bc commit 51b3313
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/htmlvideoelement.rs
Expand Up @@ -302,8 +302,8 @@ impl ImageCacheListener for HTMLVideoElement {
LoadBlocker::terminate(&mut *self.load_blocker.borrow_mut());
},
ImageResponse::MetadataLoaded(..) => {},
ImageResponse::PlaceholderLoaded(..) => unreachable!(),
ImageResponse::None => {
// The image cache may have loaded a placeholder for an invalid poster url
ImageResponse::PlaceholderLoaded(..) | ImageResponse::None => {
// A failed load should unblock the document load.
LoadBlocker::terminate(&mut *self.load_blocker.borrow_mut());
},
Expand Down

0 comments on commit 51b3313

Please sign in to comment.