Skip to content

Commit 0f59b4e

Browse files
authored
Merge branch 'trunk' into trunk
2 parents af79ad6 + 3c272f1 commit 0f59b4e

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

common/crypt/blake2b.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <stdint.h>
66
#include <stddef.h>
77
#include <crypt/blake2b.h>
8-
#include <fs/file.h>
98
#include <lib/libc.h>
109
#include <lib/misc.h>
1110
#include <mm/pmm.h>

common/lib/image.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct image *image_open(struct file_handle *file) {
4040
if (image->img == NULL || x == 0 || y == 0) {
4141
if (image->img != NULL) {
4242
// stbi allocated but dimensions are degenerate
43-
pmm_free(image->img, (size_t)x * (size_t)y * 4);
43+
stbi_image_free(image->img);
4444
}
4545
pmm_free(image, sizeof(struct image));
4646
return NULL;
@@ -49,15 +49,15 @@ struct image *image_open(struct file_handle *file) {
4949
// Convert ABGR to XRGB
5050
uint32_t *pptr = (void *)image->img;
5151
size_t pixel_count = CHECKED_MUL((size_t)x, (size_t)y,
52-
({ pmm_free(image, sizeof(struct image)); return NULL; }));
52+
({ stbi_image_free(image->img); pmm_free(image, sizeof(struct image)); return NULL; }));
5353
for (size_t i = 0; i < pixel_count; i++) {
5454
pptr[i] = (pptr[i] & 0x0000ff00) | ((pptr[i] & 0x00ff0000) >> 16) | ((pptr[i] & 0x000000ff) << 16);
5555
}
5656

5757
image->x_size = x;
5858
image->y_size = y;
5959
image->pitch = (int)CHECKED_MUL((size_t)x, 4,
60-
({ pmm_free(image, sizeof(struct image)); return NULL; }));
60+
({ stbi_image_free(image->img); pmm_free(image, sizeof(struct image)); return NULL; }));
6161
image->bpp = 32;
6262
image->img_width = x;
6363
image->img_height = y;

common/menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ noreturn void _menu(bool first_run) {
13221322
}
13231323

13241324
if (!skip_timeout && !timeout) {
1325-
if (max_entries == 0 || selected_menu_entry->sub != NULL) {
1325+
if (max_entries == 0 || selected_menu_entry == NULL || selected_menu_entry->sub != NULL) {
13261326
quiet = false;
13271327
print("Default entry is not valid or directory, booting to menu.\n");
13281328
skip_timeout = true;

0 commit comments

Comments
 (0)