projects
/
libopano.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ef898ea
)
viewer.c: Fix a segfault when resizing the window.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sat, 18 Aug 2007 10:24:57 +0000
(12:24 +0200)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sat, 18 Aug 2007 10:24:57 +0000
(12:24 +0200)
src/viewer.c
patch
|
blob
|
history
diff --git
a/src/viewer.c
b/src/viewer.c
index
7516db2
..
3494d19
100644
(file)
--- a/
src/viewer.c
+++ b/
src/viewer.c
@@
-134,13
+134,13
@@
static int draw_window (const ui_image_t *img)
if ((ximage != NULL) && ((img->width != ximage->width) || (img->height != ximage->height)))
{
free (ximage->data);
if ((ximage != NULL) && ((img->width != ximage->width) || (img->height != ximage->height)))
{
free (ximage->data);
+ ximage->data = NULL;
XDestroyImage (ximage);
ximage = NULL;
}
if (ximage == NULL)
{
XDestroyImage (ximage);
ximage = NULL;
}
if (ximage == NULL)
{
- char *data;
ximage = XCreateImage(disp_g, visual_g, depth_g, ZPixmap, 0,
NULL, img->width, img->height,
8, 0);
ximage = XCreateImage(disp_g, visual_g, depth_g, ZPixmap, 0,
NULL, img->width, img->height,
8, 0);
@@
-149,8
+149,7
@@
static int draw_window (const ui_image_t *img)
ximage->byte_order= MSBFirst;
ximage->byte_order= MSBFirst;
- data = (char *) malloc (img->width * img->height * depth_g / 8);
- ximage->data = data;
+ ximage->data = (char *) malloc (img->width * img->height * depth_g / 8);
if (ximage->data == NULL)
{
XDestroyImage (ximage);
if (ximage->data == NULL)
{
XDestroyImage (ximage);