summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/image_decoder.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2023-03-14 12:19:48 +0000
committerAidan MacDonald <amachronic@protonmail.com>2023-03-21 16:23:54 -0400
commitd40a598970b04bfe3a867a5e12debc45c149b46b (patch)
tree26e974f910f7d3047adfbc536d8e10c2d973b7e9 /apps/plugins/imageviewer/image_decoder.c
parent2fb2364686e5470437f0ee3d214662d51067eb90 (diff)
downloadrockbox-d40a598970b04bfe3a867a5e12debc45c149b46b.tar.gz
rockbox-d40a598970b04bfe3a867a5e12debc45c149b46b.zip
plugins: Simplify plugin/codec API versioning
Replace the minimum version bound with a check on the size of the API struct. The version only needs to be incremented for ABI breaking changes. Additions to the API won't need to touch the version number, resulting in fewer merge conflicts. Change-Id: I916a04a7bf5890dcf5d615ce30087643165f8e1f
Diffstat (limited to 'apps/plugins/imageviewer/image_decoder.c')
-rw-r--r--apps/plugins/imageviewer/image_decoder.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/plugins/imageviewer/image_decoder.c b/apps/plugins/imageviewer/image_decoder.c
index eab1c01dbc..0c1776daaa 100644
--- a/apps/plugins/imageviewer/image_decoder.c
+++ b/apps/plugins/imageviewer/image_decoder.c
@@ -155,7 +155,10 @@ const struct image_decoder *load_decoder(struct loader_info *loader_info)
155 goto error_close; 155 goto error_close;
156 } 156 }
157 157
158 if (lc_hdr->api_version != IMGDEC_API_VERSION) 158 if (lc_hdr->api_version != IMGDEC_API_VERSION ||
159 hdr->img_api_size > sizeof(struct imgdec_api) ||
160 hdr->plugin_api_version != PLUGIN_API_VERSION ||
161 hdr->plugin_api_size > sizeof(struct plugin_api))
159 { 162 {
160 rb->splashf(2*HZ, "%s decoder: Incompatible version.", name); 163 rb->splashf(2*HZ, "%s decoder: Incompatible version.", name);
161 goto error_close; 164 goto error_close;