Fix crash on loading animated webp alpha

This commit is contained in:
Philip Kristoffersen
2022-09-08 17:05:17 +02:00
parent ddf60a2828
commit 941b647986
7 changed files with 21 additions and 11 deletions
Generated
+2 -2
View File
@@ -168,7 +168,7 @@ dependencies = [
[[package]] [[package]]
name = "boilr" name = "boilr"
version = "1.4.8" version = "1.4.9"
dependencies = [ dependencies = [
"base64", "base64",
"chrono", "chrono",
@@ -1340,7 +1340,7 @@ dependencies = [
[[package]] [[package]]
name = "image" name = "image"
version = "0.24.3" version = "0.24.3"
source = "git+https://github.com/PhilipK/image?rev=cb66840dd42785c7283206cc9805240501695a61#cb66840dd42785c7283206cc9805240501695a61" source = "git+https://github.com/PhilipK/image?rev=55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5#55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"byteorder", "byteorder",
+2 -2
View File
@@ -1,7 +1,7 @@
[package] [package]
edition = "2021" edition = "2021"
name = "boilr" name = "boilr"
version = "1.4.8" version = "1.4.9"
[dependencies] [dependencies]
base64 = "^0.13.0" base64 = "^0.13.0"
@@ -35,7 +35,7 @@ version = "^0.3.23"
[dependencies.image] [dependencies.image]
features = ["png","webp","jpeg"] features = ["png","webp","jpeg"]
git = "https://github.com/PhilipK/image" git = "https://github.com/PhilipK/image"
rev = "cb66840dd42785c7283206cc9805240501695a61" rev = "55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5"
[dependencies.reqwest] [dependencies.reqwest]
default_features = false default_features = false
+4 -4
View File
@@ -2,8 +2,8 @@
{ {
"type": "git", "type": "git",
"url": "https://github.com/philipk/image", "url": "https://github.com/philipk/image",
"commit": "cb66840dd42785c7283206cc9805240501695a61", "commit": "55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5",
"dest": "flatpak-cargo/git/image-cb66840" "dest": "flatpak-cargo/git/image-55a6684"
}, },
{ {
"type": "archive", "type": "archive",
@@ -1685,7 +1685,7 @@
{ {
"type": "shell", "type": "shell",
"commands": [ "commands": [
"cp -r --reflink=auto \"flatpak-cargo/git/image-cb66840/.\" \"cargo/vendor/image\"" "cp -r --reflink=auto \"flatpak-cargo/git\\image-55a6684\\.\" \"cargo/vendor/image\""
] ]
}, },
{ {
@@ -4439,7 +4439,7 @@
}, },
{ {
"type": "inline", "type": "inline",
"contents": "[source.vendored-sources]\ndirectory = \"cargo/vendor\"\n\n[source.crates-io]\nreplace-with = \"vendored-sources\"\n\n[source.\"https://github.com/philipk/image\"]\ngit = \"https://github.com/philipk/image\"\nreplace-with = \"vendored-sources\"\nrev = \"cb66840dd42785c7283206cc9805240501695a61\"\n", "contents": "[source.vendored-sources]\ndirectory = \"cargo/vendor\"\n\n[source.crates-io]\nreplace-with = \"vendored-sources\"\n\n[source.\"https://github.com/philipk/image\"]\ngit = \"https://github.com/philipk/image\"\nreplace-with = \"vendored-sources\"\nrev = \"55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5\"\n",
"dest": "cargo", "dest": "cargo",
"dest-filename": "config" "dest-filename": "config"
} }
@@ -25,6 +25,13 @@ https://hughsie.github.io/oars/index.html
--> -->
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
<releases> <releases>
<release version="1.4.9" date="2022-09-08">
<description>
<ul>
<li>Fixed a crash that would happen when loading specific animated webp images that use alpha blending</li>
</ul>
</description>
</release>
<release version="1.4.8" date="2022-09-06"> <release version="1.4.8" date="2022-09-06">
<description> <description>
<ul> <ul>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 872 KiB

+6
View File
@@ -94,4 +94,10 @@ mod tests {
let res = load_image_from_path(std::path::Path::new("src/testdata/hollow.webp")); let res = load_image_from_path(std::path::Path::new("src/testdata/hollow.webp"));
assert!(res.is_err()); assert!(res.is_err());
} }
#[test]
pub fn test_image_load_animated_webp2() {
let res = load_image_from_path(std::path::Path::new("src/testdata/tunic.webp"));
assert!(res.is_err());
}
} }
-3
View File
@@ -577,9 +577,6 @@ impl MyEguiApp {
let thumbnail_key = image.thumbnail_path.to_string_lossy().to_string(); let thumbnail_key = image.thumbnail_path.to_string_lossy().to_string();
let thumbnail = self.image_selected_state.image_handles.remove(&thumbnail_key); let thumbnail = self.image_selected_state.image_handles.remove(&thumbnail_key);
if let Some((key,thumbnail)) = thumbnail { if let Some((key,thumbnail)) = thumbnail {
dbg!(&full_image_key);
dbg!(&key);
self.image_selected_state self.image_selected_state
.image_handles .image_handles
.insert(full_image_key, thumbnail); .insert(full_image_key, thumbnail);