diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-04-02 21:10:26 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-04-02 21:10:26 +0100 |
commit | 527bc23bdba33f1db6194c5d95f41f8a6b603bd5 (patch) | |
tree | 929b58fcd959f660e8841dbe00baa2a751faf6fe /riscos/treeview.c | |
parent | 979b59887f6e868908519640fc795db0070371f7 (diff) | |
download | netsurf-527bc23bdba33f1db6194c5d95f41f8a6b603bd5.tar.gz netsurf-527bc23bdba33f1db6194c5d95f41f8a6b603bd5.tar.bz2 |
Avoid potential NULL ptr deref found by cppcheck.
Diffstat (limited to 'riscos/treeview.c')
-rw-r--r-- | riscos/treeview.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/riscos/treeview.c b/riscos/treeview.c index 4cf3d425e..0c16626ad 100644 --- a/riscos/treeview.c +++ b/riscos/treeview.c @@ -435,14 +435,15 @@ void ro_treeview_redraw_loop(wimp_draw *redraw, ro_treeview *tv, osbool more) }; while (more) { - ro_plot_origin_x = redraw->box.x0 + tv->origin.x - - redraw->xscroll; - ro_plot_origin_y = redraw->box.y1 + tv->origin.y - - redraw->yscroll; if (tv != NULL && tv->tree != NULL) { struct rect clip; + ro_plot_origin_x = redraw->box.x0 + tv->origin.x - + redraw->xscroll; + ro_plot_origin_y = redraw->box.y1 + tv->origin.y - + redraw->yscroll; + clip.x0 = (redraw->clip.x0 - ro_plot_origin_x) / 2; clip.y0 = (ro_plot_origin_y - redraw->clip.y1) / 2; |