Fix open_ui bug where client will crash with a null pointer exception if the prerender_save function returns null due to newer save or other

This commit is contained in:
Simon 2010-12-06 19:45:01 +00:00
parent 122babe356
commit ae828393ce
2 changed files with 9 additions and 4 deletions

View File

@ -8,7 +8,7 @@
#endif
#define SAVE_VERSION 44
#define MINOR_VERSION 1
#define MINOR_VERSION 2
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
#define BETA

View File

@ -2720,9 +2720,14 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
if(status == 200)
{
pixel *full_save = prerender_save(data, data_size, &imgw, &imgh);
save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2);
data_ready = 1;
free(full_save);
if(full_save!=NULL){
save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2);
data_ready = 1;
free(full_save);
} else {
error_ui(vid_buf, 0, "Save may be from a newer version");
break;
}
}
active = 0;
free(http);