diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-10-15 09:08:09 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2022-10-15 09:26:58 -0400 |
commit | 12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69 (patch) | |
tree | b4885951a5cba1b78c21b30ce37a1d6f1574aa5f /apps/rbcodec_helpers.c | |
parent | 9d3d925295112a0080bc1d70fad170db9e1af2a9 (diff) | |
download | rockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.tar.gz rockbox-12ef045fdf5a9e2b4d5618cc3b7ba50ecc0ccf69.zip |
move buflib_free invalid handle check to the function
allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free
Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
Diffstat (limited to 'apps/rbcodec_helpers.c')
-rw-r--r-- | apps/rbcodec_helpers.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/apps/rbcodec_helpers.c b/apps/rbcodec_helpers.c index 78e068ded7..b856d7355d 100644 --- a/apps/rbcodec_helpers.c +++ b/apps/rbcodec_helpers.c | |||
@@ -87,10 +87,7 @@ void tdspeed_free_buffers(int32_t **buffers, int nbuf) | |||
87 | { | 87 | { |
88 | for (int i = 0; i < nbuf; i++) | 88 | for (int i = 0; i < nbuf; i++) |
89 | { | 89 | { |
90 | if (handles[i] > 0) | 90 | handles[i] = core_free(handles[i]); |
91 | core_free(handles[i]); | ||
92 | |||
93 | handles[i] = 0; | ||
94 | buffers[i] = NULL; | 91 | buffers[i] = NULL; |
95 | } | 92 | } |
96 | } | 93 | } |