diff options
| author | Simon <simon@hardwired.org.uk> | 2010-12-06 19:45:01 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2010-12-06 19:45:01 (GMT) |
| commit | ae828393ce38b4a15ed9f9b47d615eb5505d5f47 (patch) | |
| tree | 4e68ff860b3ab9666101bbf1474c20b2c2edf9b6 /src | |
| parent | 122babe356fc975f4bd4aa7c9e9ed212a6003d1f (diff) | |
| download | powder-ae828393ce38b4a15ed9f9b47d615eb5505d5f47.zip powder-ae828393ce38b4a15ed9f9b47d615eb5505d5f47.tar.gz | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/interface.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/interface.c b/src/interface.c index 191ddf0..5b9a133 100644 --- a/src/interface.c +++ b/src/interface.c @@ -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); |
