Changeset 222d90e0f1b6efc6421228392e02a3906680d5c7
- Timestamp:
- 31/05/08 16:04:37
(4 months ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1212242677 +0200
- git-parent:
[b39f83c87a5234cfbb8de61364d757288f4880c7]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1212242677 +0200
- Message:
Check malloc return value
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r59dec65 |
r222d90e |
|
| 109 | 109 | { |
|---|
| 110 | 110 | access_t *p_src = p_access->p_source; |
|---|
| 111 | | /* */ |
|---|
| | 111 | |
|---|
| 112 | 112 | p_access->info = p_src->info; |
|---|
| 113 | 113 | p_access->p_sys->i_update_sav = p_access->info.i_update; |
|---|
| … | … | |
| 125 | 125 | char *psz; |
|---|
| 126 | 126 | |
|---|
| 127 | | /* */ |
|---|
| 128 | 127 | p_access->pf_read = p_src->pf_read ? Read : NULL; |
|---|
| 129 | 128 | p_access->pf_block = p_src->pf_block ? Block : NULL; |
|---|
| … | … | |
| 131 | 130 | p_access->pf_control = Control; |
|---|
| 132 | 131 | |
|---|
| 133 | | /* */ |
|---|
| 134 | 132 | p_access->info = p_src->info; |
|---|
| 135 | 133 | |
|---|
| 136 | | /* */ |
|---|
| 137 | 134 | p_access->p_sys = p_sys = malloc( sizeof( access_t ) ); |
|---|
| | 135 | if( !p_sys ) return VLC_ENOMEM; |
|---|
| 138 | 136 | |
|---|
| 139 | 137 | /* */ |
|---|
| … | … | |
| 194 | 192 | block_t *p_block; |
|---|
| 195 | 193 | |
|---|
| 196 | | /* */ |
|---|
| 197 | 194 | PreUpdateFlags( p_access ); |
|---|
| 198 | 195 | |
|---|
| 199 | | /* */ |
|---|
| 200 | 196 | p_block = p_src->pf_block( p_src ); |
|---|
| 201 | 197 | if( p_block && p_block->i_buffer ) |
|---|
| 202 | 198 | Dump( p_access, p_block->p_buffer, p_block->i_buffer ); |
|---|
| 203 | 199 | |
|---|
| 204 | | /* */ |
|---|
| 205 | 200 | PostUpdateFlags( p_access ); |
|---|
| 206 | 201 | |
|---|
| … | … | |
| 216 | 211 | int i_ret; |
|---|
| 217 | 212 | |
|---|
| 218 | | /* */ |
|---|
| 219 | 213 | PreUpdateFlags( p_access ); |
|---|
| 220 | 214 | |
|---|
| 221 | | /* */ |
|---|
| 222 | 215 | i_ret = p_src->pf_read( p_src, p_buffer, i_len ); |
|---|
| 223 | | |
|---|
| 224 | 216 | if( i_ret > 0 ) |
|---|
| 225 | 217 | Dump( p_access, p_buffer, i_ret ); |
|---|
| 226 | 218 | |
|---|
| 227 | | /* */ |
|---|
| 228 | 219 | PostUpdateFlags( p_access ); |
|---|
| 229 | 220 | |
|---|
| … | … | |
| 239 | 230 | int i_ret; |
|---|
| 240 | 231 | |
|---|
| 241 | | /* */ |
|---|
| 242 | 232 | PreUpdateFlags( p_access ); |
|---|
| 243 | 233 | |
|---|
| 244 | | /* */ |
|---|
| 245 | 234 | i_ret = p_src->pf_control( p_src, i_query, args ); |
|---|
| 246 | 235 | |
|---|
| 247 | | /* */ |
|---|
| 248 | 236 | PostUpdateFlags( p_access ); |
|---|
| 249 | 237 | |
|---|
| … | … | |
| 259 | 247 | int i_ret; |
|---|
| 260 | 248 | |
|---|
| 261 | | /* */ |
|---|
| 262 | 249 | PreUpdateFlags( p_access ); |
|---|
| 263 | 250 | |
|---|
| 264 | | /* */ |
|---|
| 265 | 251 | i_ret = p_src->pf_seek( p_src, i_pos ); |
|---|
| 266 | 252 | |
|---|
| 267 | | /* */ |
|---|
| 268 | 253 | PostUpdateFlags( p_access ); |
|---|
| 269 | 254 | |
|---|
| … | … | |
| 331 | 316 | int i_write; |
|---|
| 332 | 317 | |
|---|
| 333 | | /* */ |
|---|
| 334 | 318 | if( !p_sys->b_dump ) |
|---|
| 335 | 319 | { |
|---|
| … | … | |
| 352 | 336 | } |
|---|
| 353 | 337 | |
|---|
| 354 | | /* */ |
|---|
| 355 | 338 | if( !p_sys->f ) |
|---|
| 356 | 339 | { |
|---|
| … | … | |
| 449 | 432 | } |
|---|
| 450 | 433 | |
|---|
| 451 | | /* */ |
|---|
| 452 | 434 | if( ( i_write = fwrite( p_buffer, 1, i_buffer, p_sys->f ) ) > 0 ) |
|---|
| 453 | 435 | p_sys->i_size += i_write; |
|---|