From d40a598970b04bfe3a867a5e12debc45c149b46b Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 14 Mar 2023 12:19:48 +0000 Subject: 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 --- apps/codecs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/codecs.c') diff --git a/apps/codecs.c b/apps/codecs.c index 4d2dd34ce0..9f34d26e14 100644 --- a/apps/codecs.c +++ b/apps/codecs.c @@ -203,8 +203,9 @@ static int codec_load_ram(struct codec_api *api) return CODEC_ERROR; } - if (hdr->api_version > CODEC_API_VERSION - || hdr->api_version < CODEC_MIN_API_VERSION) { + if (hdr->api_version != CODEC_API_VERSION || + c_hdr->api_size > sizeof(struct codec_api)) + { logf("codec api version error"); lc_close(curr_handle); curr_handle = NULL; -- cgit v1.2.3