Alternate patch attached.- Adds a dummy handler for the initial value of gui_mode.- Remove the gui_get_mode() function in favour of camera_info.state.gui_mode
camera_info.state.gui_mode != 0
Quote from: philmoz on 20 / November / 2019, 19:10:21Alternate patch attached.- Adds a dummy handler for the initial value of gui_mode.- Remove the gui_get_mode() function in favour of camera_info.state.gui_modeThat seems OK to me. Tested booting to play and rec without issue on digic 4 (elph180) and digic 6 (sx710)One thing I wondered is if there is code that relies on gui_mode == 0 being "none". The closest I found was script, which uses Code: [Select]camera_info.state.gui_mode != 0for get_alt_mode(). This should not have any issue with the patch, since script shouldn't be able to run before gui_init. (I assume it doesn't use camera_info.state.gui_mode_alt because script is technically a different gui_mode, even though it has alt and non-alt states)
Anything that might use camera_info.state.gui_mode before gui_init is called should be unaffected (I think).
Alternate patch attached.
Quote from: philmoz on 20 / November / 2019, 16:04:19Quote from: reyalp on 20 / November / 2019, 15:23:42Quote from: philmoz on 20 / November / 2019, 15:03:07I can't see any other cases - am I missing anything?Perhaps stating the obvious, but I assume the ones srsa_4c is hitting is the ones gui_set_mode where it references old_mode->... on 2474 and 2477It seems like those could just be skipped if old_mode is null, though I'm not immediately sure whether redraw / restore stuff should be called on the first call.gui_set_mode also returns old_mode, which would be NULL in this case, but the value isn't used in gui_init.Good point, missed that case.Setting a default for gui_mode makes more sense now - I'm not fully comfortable with the idea of using the alt mode handler though.Perhaps a dummy handler struct for startup until gui_init is called might work.Phil.Alternate patch attached.- Adds a dummy handler for the initial value of gui_mode.- Remove the gui_get_mode() function in favour of camera_info.state.gui_modePhil.
Quote from: reyalp on 20 / November / 2019, 15:23:42Quote from: philmoz on 20 / November / 2019, 15:03:07I can't see any other cases - am I missing anything?Perhaps stating the obvious, but I assume the ones srsa_4c is hitting is the ones gui_set_mode where it references old_mode->... on 2474 and 2477It seems like those could just be skipped if old_mode is null, though I'm not immediately sure whether redraw / restore stuff should be called on the first call.gui_set_mode also returns old_mode, which would be NULL in this case, but the value isn't used in gui_init.Good point, missed that case.Setting a default for gui_mode makes more sense now - I'm not fully comfortable with the idea of using the alt mode handler though.Perhaps a dummy handler struct for startup until gui_init is called might work.Phil.
Quote from: philmoz on 20 / November / 2019, 15:03:07I can't see any other cases - am I missing anything?Perhaps stating the obvious, but I assume the ones srsa_4c is hitting is the ones gui_set_mode where it references old_mode->... on 2474 and 2477It seems like those could just be skipped if old_mode is null, though I'm not immediately sure whether redraw / restore stuff should be called on the first call.gui_set_mode also returns old_mode, which would be NULL in this case, but the value isn't used in gui_init.
I can't see any other cases - am I missing anything?
Is it worth adding to the release-1_4 branch?
Question on revision 5294 for Ixus 220.This changed both code_gen.txt and boot.c for 1.00c, 1.01a and 1.01g; but only changed code_gen.txt for version 1.01c.
Index: core/shooting.c===================================================================--- core/shooting.c (revision 5331)+++ core/shooting.c (working copy)@@ -1053,7 +1053,7 @@ int fl = get_focal_length(zoom_point); short f_focus_ok = shooting_get_focus_ok(); short f_hyp_calc = 0, f_dist_calc = 0;- short min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point];+ short min_av96_zoom_point = 0; short av96 = shooting_get_user_av96(); short curr_av96 = shooting_get_current_av96(); short prop_av96 = shooting_get_av96();@@ -1063,8 +1063,10 @@ min_av96_zoom_point_tbl = (short *) malloc(zoom_points * sizeof(short)); if (min_av96_zoom_point_tbl) { memset(min_av96_zoom_point_tbl, 0, zoom_points * sizeof(short));- min_av96_zoom_point = 0; }+ else {+ return;+ } } else min_av96_zoom_point = min_av96_zoom_point_tbl[zoom_point]; if (min_av96_zoom_point==0 && shooting_in_progress()) {
Found yet another case of a dereferenced null pointer.Question is the usual, does the following fix look okay?
Started by andre117 General Discussion and Assistance
Started by Bernd R General Discussion and Assistance
Started by quid « 1 2 » General Discussion and Assistance
Started by zell « 1 2 » General Discussion and Assistance
Started by srsa_4c « 1 2 » General Discussion and Assistance