Lines 1-164
Link Here
|
1 |
diff -u sdl-image1.2-1.2.5/IMG_bmp.c IMG_bmp.c |
|
|
2 |
--- sdl-image1.2-1.2.5/IMG_bmp.c 2006-05-14 17:57:03.000000000 -0300 |
3 |
+++ IMG_bmp.c 2006-07-21 20:34:29.193015440 -0300 |
4 |
@@ -36,6 +36,8 @@ |
5 |
int is_BMP; |
6 |
char magic[2]; |
7 |
|
8 |
+ if ( !src ) |
9 |
+ return 0; |
10 |
start = SDL_RWtell(src); |
11 |
is_BMP = 0; |
12 |
if ( SDL_RWread(src, magic, sizeof(magic), 1) ) { |
13 |
diff -u sdl-image1.2-1.2.5/IMG_gif.c IMG_gif.c |
14 |
--- sdl-image1.2-1.2.5/IMG_gif.c 2006-05-14 16:54:24.000000000 -0300 |
15 |
+++ IMG_gif.c 2006-07-21 20:33:22.437423410 -0300 |
16 |
@@ -36,6 +36,8 @@ |
17 |
int is_GIF; |
18 |
char magic[6]; |
19 |
|
20 |
+ if ( !src ) |
21 |
+ return 0; |
22 |
start = SDL_RWtell(src); |
23 |
is_GIF = 0; |
24 |
if ( SDL_RWread(src, magic, sizeof(magic), 1) ) { |
25 |
diff -u sdl-image1.2-1.2.5/IMG_jpg.c IMG_jpg.c |
26 |
--- sdl-image1.2-1.2.5/IMG_jpg.c 2006-05-14 16:54:24.000000000 -0300 |
27 |
+++ IMG_jpg.c 2006-07-21 20:22:29.386350188 -0300 |
28 |
@@ -179,6 +179,8 @@ |
29 |
/* Blame me, not Sam, if this doesn't work right. */ |
30 |
/* And don't forget to report the problem to the the sdl list too! */ |
31 |
|
32 |
+ if ( !src ) |
33 |
+ return 0; |
34 |
start = SDL_RWtell(src); |
35 |
is_JPG = 0; |
36 |
in_scan = 0; |
37 |
diff -u sdl-image1.2-1.2.5/IMG_lbm.c IMG_lbm.c |
38 |
--- sdl-image1.2-1.2.5/IMG_lbm.c 2006-05-12 00:02:44.000000000 -0300 |
39 |
+++ IMG_lbm.c 2006-07-21 20:33:14.278818049 -0300 |
40 |
@@ -65,6 +65,8 @@ |
41 |
int is_LBM; |
42 |
Uint8 magic[4+4+4]; |
43 |
|
44 |
+ if ( !src ) |
45 |
+ return 0; |
46 |
start = SDL_RWtell(src); |
47 |
is_LBM = 0; |
48 |
if ( SDL_RWread( src, magic, sizeof(magic), 1 ) ) |
49 |
diff -u sdl-image1.2-1.2.5/IMG_pcx.c IMG_pcx.c |
50 |
--- sdl-image1.2-1.2.5/IMG_pcx.c 2006-05-01 04:25:51.000000000 -0300 |
51 |
+++ IMG_pcx.c 2006-07-21 20:25:15.919749204 -0300 |
52 |
@@ -69,6 +69,8 @@ |
53 |
const int PCX_RunLength_Encoding = 1; |
54 |
struct PCXheader pcxh; |
55 |
|
56 |
+ if ( !src ) |
57 |
+ return 0; |
58 |
start = SDL_RWtell(src); |
59 |
is_PCX = 0; |
60 |
if ( SDL_RWread(src, &pcxh, sizeof(pcxh), 1) == 1 ) { |
61 |
diff -u sdl-image1.2-1.2.5/IMG_png.c IMG_png.c |
62 |
--- sdl-image1.2-1.2.5/IMG_png.c 2006-05-14 16:54:24.000000000 -0300 |
63 |
+++ IMG_png.c 2006-07-21 20:25:07.367217023 -0300 |
64 |
@@ -273,6 +273,8 @@ |
65 |
if ( IMG_InitPNG() < 0 ) { |
66 |
return 0; |
67 |
} |
68 |
+ if ( !src ) |
69 |
+ return 0; |
70 |
start = SDL_RWtell(src); |
71 |
is_PNG = 0; |
72 |
if ( SDL_RWread(src, buf, 1, PNG_BYTES_TO_CHECK) == PNG_BYTES_TO_CHECK ) { |
73 |
diff -u sdl-image1.2-1.2.5/IMG_pnm.c IMG_pnm.c |
74 |
--- sdl-image1.2-1.2.5/IMG_pnm.c 2006-05-01 04:25:51.000000000 -0300 |
75 |
+++ IMG_pnm.c 2006-07-21 20:26:06.881005273 -0300 |
76 |
@@ -44,6 +44,8 @@ |
77 |
int is_PNM; |
78 |
char magic[2]; |
79 |
|
80 |
+ if ( !src ) |
81 |
+ return 0; |
82 |
start = SDL_RWtell(src); |
83 |
is_PNM = 0; |
84 |
if ( SDL_RWread(src, magic, sizeof(magic), 1) ) { |
85 |
diff -u sdl-image1.2-1.2.5/IMG_tif.c IMG_tif.c |
86 |
--- sdl-image1.2-1.2.5/IMG_tif.c 2006-07-21 20:31:17.000000000 -0300 |
87 |
+++ IMG_tif.c 2006-07-21 20:27:09.959187601 -0300 |
88 |
@@ -189,6 +189,8 @@ |
89 |
if ( IMG_InitTIF() < 0 ) { |
90 |
return 0; |
91 |
} |
92 |
+ if ( !src ) |
93 |
+ return 0; |
94 |
start = SDL_RWtell(src); |
95 |
is_TIF = 0; |
96 |
|
97 |
diff -u sdl-image1.2-1.2.5/IMG_xcf.c IMG_xcf.c |
98 |
--- sdl-image1.2-1.2.5/IMG_xcf.c 2006-05-01 04:25:51.000000000 -0300 |
99 |
+++ IMG_xcf.c 2006-07-21 20:28:49.113194657 -0300 |
100 |
@@ -213,6 +213,8 @@ |
101 |
int is_XCF; |
102 |
char magic[14]; |
103 |
|
104 |
+ if ( !src ) |
105 |
+ return 0; |
106 |
start = SDL_RWtell(src); |
107 |
is_XCF = 0; |
108 |
if ( SDL_RWread(src, magic, sizeof(magic), 1) ) { |
109 |
diff -u sdl-image1.2-1.2.5/IMG_xpm.c IMG_xpm.c |
110 |
--- sdl-image1.2-1.2.5/IMG_xpm.c 2006-05-12 00:02:44.000000000 -0300 |
111 |
+++ IMG_xpm.c 2006-07-21 20:33:29.517213256 -0300 |
112 |
@@ -59,6 +59,8 @@ |
113 |
int is_XPM; |
114 |
char magic[9]; |
115 |
|
116 |
+ if ( !src ) |
117 |
+ return 0; |
118 |
start = SDL_RWtell(src); |
119 |
is_XPM = 0; |
120 |
if ( SDL_RWread(src, magic, sizeof(magic), 1) ) { |
121 |
@@ -326,7 +328,8 @@ |
122 |
linebuf = NULL; |
123 |
buflen = 0; |
124 |
|
125 |
- start = SDL_RWtell(src); |
126 |
+ if ( src ) |
127 |
+ start = SDL_RWtell(src); |
128 |
|
129 |
if(xpm) |
130 |
xpmlines = &xpm; |
131 |
@@ -453,7 +456,8 @@ |
132 |
|
133 |
done: |
134 |
if(error) { |
135 |
- SDL_RWseek(src, start, SEEK_SET); |
136 |
+ if ( src ) |
137 |
+ SDL_RWseek(src, start, SEEK_SET); |
138 |
if ( image ) { |
139 |
SDL_FreeSurface(image); |
140 |
image = NULL; |
141 |
diff -u sdl-image1.2-1.2.5/IMG_xv.c IMG_xv.c |
142 |
--- sdl-image1.2-1.2.5/IMG_xv.c 2006-05-01 04:25:51.000000000 -0300 |
143 |
+++ IMG_xv.c 2006-07-21 20:29:16.504502815 -0300 |
144 |
@@ -89,6 +89,8 @@ |
145 |
int is_XV; |
146 |
int w, h; |
147 |
|
148 |
+ if ( !src ) |
149 |
+ return 0; |
150 |
start = SDL_RWtell(src); |
151 |
is_XV = 0; |
152 |
if ( get_header(src, &w, &h) == 0 ) { |
153 |
diff -u sdl-image1.2-1.2.5/IMG_xxx.c IMG_xxx.c |
154 |
--- sdl-image1.2-1.2.5/IMG_xxx.c 2006-05-01 04:25:51.000000000 -0300 |
155 |
+++ IMG_xxx.c 2006-07-21 20:29:57.169539262 -0300 |
156 |
@@ -34,6 +34,8 @@ |
157 |
int start; |
158 |
int is_XXX; |
159 |
|
160 |
+ if ( !src ) |
161 |
+ return 0; |
162 |
start = SDL_RWtell(src); |
163 |
is_XXX = 0; |
164 |
|