File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 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>
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments