Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 137059 | Differences between
and this patch

Collapse All | Expand All

(-)electricsheep/client/flam3/png.c (-4 / +13 lines)
Lines 14-19 Link Here
14
#include <stdio.h>
14
#include <stdio.h>
15
#include <stdlib.h>
15
#include <stdlib.h>
16
#include <png.h>
16
#include <png.h>
17
#include <setjmp.h>
17
18
18
#include "img.h"
19
#include "img.h"
19
20
Lines 67-73 Link Here
67
  unsigned char sig_buf [SIG_CHECK_SIZE];
68
  unsigned char sig_buf [SIG_CHECK_SIZE];
68
  png_struct *png_ptr;
69
  png_struct *png_ptr;
69
  png_info *info_ptr;
70
  png_info *info_ptr;
70
  png_byte **png_image;
71
  png_byte **png_image = NULL;
71
  int linesize, x, y;
72
  int linesize, x, y;
72
  unsigned char *p, *q;
73
  unsigned char *p, *q;
73
74
Lines 85-90 Link Here
85
    fprintf (stderr, "cannot allocate LIBPNG structure\n");
86
    fprintf (stderr, "cannot allocate LIBPNG structure\n");
86
    return 0;
87
    return 0;
87
  }
88
  }
89
  if (setjmp(png_jmpbuf(png_ptr))) {
90
     if (png_image) {
91
	 for (y = 0 ; y < info_ptr->height ; y++)
92
	     free (png_image[y]);
93
	 free (png_image);
94
     }
95
     png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
96
     perror("reading file");
97
     return;
98
  }
88
  info_ptr = png_create_info_struct (png_ptr);
99
  info_ptr = png_create_info_struct (png_ptr);
89
  if (info_ptr == NULL) {
100
  if (info_ptr == NULL) {
90
    png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
101
    png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
Lines 155-163 Link Here
155
  for (y = 0 ; y < info_ptr->height ; y++)
166
  for (y = 0 ; y < info_ptr->height ; y++)
156
    free (png_image[y]);
167
    free (png_image[y]);
157
  free (png_image);
168
  free (png_image);
158
  png_read_destroy (png_ptr, info_ptr, (png_info *)0);  
169
  png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);  
159
  free (png_ptr);
160
  free (info_ptr);
161
170
162
  return q;
171
  return q;
163
}
172
}
(-)electricsheep/client/mpeg2dec/libvo/video_out_x11.c (-7 / +18 lines)
Lines 39-44 Link Here
39
#include <X11/extensions/XShm.h>
39
#include <X11/extensions/XShm.h>
40
#include <inttypes.h>
40
#include <inttypes.h>
41
#include <sys/time.h>
41
#include <sys/time.h>
42
#include <png.h>
43
#include <setjmp.h>
42
44
43
#include "vroot.h"
45
#include "vroot.h"
44
#include <sys/types.h>
46
#include <sys/types.h>
Lines 124-131 Link Here
124
    tv_rate = tv_end;
126
    tv_rate = tv_end;
125
}
127
}
126
128
127
#include <png.h>
128
129
static char *overlay_luma = NULL;
129
static char *overlay_luma = NULL;
130
static char *overlay_alpha = NULL;
130
static char *overlay_alpha = NULL;
131
static int overlay_width;
131
static int overlay_width;
Lines 165-171 Link Here
165
  unsigned char sig_buf [SIG_CHECK_SIZE];
165
  unsigned char sig_buf [SIG_CHECK_SIZE];
166
  png_struct *png_ptr;
166
  png_struct *png_ptr;
167
  png_info *info_ptr;
167
  png_info *info_ptr;
168
  png_byte **png_image;
168
  png_byte **png_image = NULL;
169
  int linesize, x, y;
169
  int linesize, x, y;
170
  unsigned char *p, *q;
170
  unsigned char *p, *q;
171
171
Lines 183-188 Link Here
183
    fprintf (stderr, "cannot allocate LIBPNG structure\n");
183
    fprintf (stderr, "cannot allocate LIBPNG structure\n");
184
    return;
184
    return;
185
  }
185
  }
186
  if (setjmp(png_jmpbuf(png_ptr))) {
187
     if (png_image) {
188
	 for (y = 0 ; y < info_ptr->height ; y++)
189
	     free (png_image[y]);
190
	 free (png_image);
191
     }
192
     png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
193
     perror("reading file");
194
     return;
195
  }
186
  info_ptr = png_create_info_struct (png_ptr);
196
  info_ptr = png_create_info_struct (png_ptr);
187
  if (info_ptr == NULL) {
197
  if (info_ptr == NULL) {
188
    png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
198
    png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
Lines 271-280 Link Here
271
  for (y = 0 ; y < info_ptr->height ; y++)
281
  for (y = 0 ; y < info_ptr->height ; y++)
272
    free (png_image[y]);
282
    free (png_image[y]);
273
  free (png_image);
283
  free (png_image);
274
  png_read_destroy (png_ptr, info_ptr, (png_info *)0);  
284
  png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);  
275
  free (png_ptr);
276
  free (info_ptr);
277
278
}
285
}
279
286
280
static void overlay_read_ppm(FILE *fin)
287
static void overlay_read_ppm(FILE *fin)
Lines 535-540 Link Here
535
      instance->corner_x = (w - instance->width)/2;
542
      instance->corner_x = (w - instance->width)/2;
536
      instance->corner_y = (h - instance->height)/2;
543
      instance->corner_y = (h - instance->height)/2;
537
    } else if (window_id == -1) {
544
    } else if (window_id == -1) {
545
      XTextProperty xname;
546
      char *nm = "Electric Sheep";
538
      /* create a window the same size as the video */
547
      /* create a window the same size as the video */
539
      instance->window =
548
      instance->window =
540
	XCreateWindow (instance->display,
549
	XCreateWindow (instance->display,
Lines 544-549 Link Here
544
		       InputOutput, instance->vinfo.visual,
553
		       InputOutput, instance->vinfo.visual,
545
		       (CWBackPixmap | CWBackingStore | CWBorderPixel |
554
		       (CWBackPixmap | CWBackingStore | CWBorderPixel |
546
			CWEventMask | CWColormap), &attr);
555
			CWEventMask | CWColormap), &attr);
556
      XStringListToTextProperty(&nm, 1, &xname);
557
      XSetWMName(instance->display, instance->window, &xname);
547
    } else {
558
    } else {
548
	/* zoomed to fit the window specified on the command line */
559
	/* zoomed to fit the window specified on the command line */
549
	XWindowAttributes xgwa;
560
	XWindowAttributes xgwa;

Return to bug 137059