Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
222d90e0
Commit
222d90e0
authored
May 31, 2008
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check malloc return value
parent
b39f83c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
20 deletions
+2
-20
modules/access_filter/record.c
modules/access_filter/record.c
+2
-20
No files found.
modules/access_filter/record.c
View file @
222d90e0
...
@@ -108,7 +108,7 @@ static inline void PreUpdateFlags( access_t *p_access )
...
@@ -108,7 +108,7 @@ static inline void PreUpdateFlags( access_t *p_access )
static
inline
void
PostUpdateFlags
(
access_t
*
p_access
)
static
inline
void
PostUpdateFlags
(
access_t
*
p_access
)
{
{
access_t
*
p_src
=
p_access
->
p_source
;
access_t
*
p_src
=
p_access
->
p_source
;
/* */
p_access
->
info
=
p_src
->
info
;
p_access
->
info
=
p_src
->
info
;
p_access
->
p_sys
->
i_update_sav
=
p_access
->
info
.
i_update
;
p_access
->
p_sys
->
i_update_sav
=
p_access
->
info
.
i_update
;
}
}
...
@@ -124,17 +124,15 @@ static int Open( vlc_object_t *p_this )
...
@@ -124,17 +124,15 @@ static int Open( vlc_object_t *p_this )
access_sys_t
*
p_sys
;
access_sys_t
*
p_sys
;
char
*
psz
;
char
*
psz
;
/* */
p_access
->
pf_read
=
p_src
->
pf_read
?
Read
:
NULL
;
p_access
->
pf_read
=
p_src
->
pf_read
?
Read
:
NULL
;
p_access
->
pf_block
=
p_src
->
pf_block
?
Block
:
NULL
;
p_access
->
pf_block
=
p_src
->
pf_block
?
Block
:
NULL
;
p_access
->
pf_seek
=
p_src
->
pf_seek
?
Seek
:
NULL
;
p_access
->
pf_seek
=
p_src
->
pf_seek
?
Seek
:
NULL
;
p_access
->
pf_control
=
Control
;
p_access
->
pf_control
=
Control
;
/* */
p_access
->
info
=
p_src
->
info
;
p_access
->
info
=
p_src
->
info
;
/* */
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_t
)
);
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
/* */
/* */
p_sys
->
f
=
NULL
;
p_sys
->
f
=
NULL
;
...
@@ -193,15 +191,12 @@ static block_t *Block( access_t *p_access )
...
@@ -193,15 +191,12 @@ static block_t *Block( access_t *p_access )
access_t
*
p_src
=
p_access
->
p_source
;
access_t
*
p_src
=
p_access
->
p_source
;
block_t
*
p_block
;
block_t
*
p_block
;
/* */
PreUpdateFlags
(
p_access
);
PreUpdateFlags
(
p_access
);
/* */
p_block
=
p_src
->
pf_block
(
p_src
);
p_block
=
p_src
->
pf_block
(
p_src
);
if
(
p_block
&&
p_block
->
i_buffer
)
if
(
p_block
&&
p_block
->
i_buffer
)
Dump
(
p_access
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
Dump
(
p_access
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
/* */
PostUpdateFlags
(
p_access
);
PostUpdateFlags
(
p_access
);
return
p_block
;
return
p_block
;
...
@@ -215,16 +210,12 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
...
@@ -215,16 +210,12 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
access_t
*
p_src
=
p_access
->
p_source
;
access_t
*
p_src
=
p_access
->
p_source
;
int
i_ret
;
int
i_ret
;
/* */
PreUpdateFlags
(
p_access
);
PreUpdateFlags
(
p_access
);
/* */
i_ret
=
p_src
->
pf_read
(
p_src
,
p_buffer
,
i_len
);
i_ret
=
p_src
->
pf_read
(
p_src
,
p_buffer
,
i_len
);
if
(
i_ret
>
0
)
if
(
i_ret
>
0
)
Dump
(
p_access
,
p_buffer
,
i_ret
);
Dump
(
p_access
,
p_buffer
,
i_ret
);
/* */
PostUpdateFlags
(
p_access
);
PostUpdateFlags
(
p_access
);
return
i_ret
;
return
i_ret
;
...
@@ -238,13 +229,10 @@ static int Control( access_t *p_access, int i_query, va_list args )
...
@@ -238,13 +229,10 @@ static int Control( access_t *p_access, int i_query, va_list args )
access_t
*
p_src
=
p_access
->
p_source
;
access_t
*
p_src
=
p_access
->
p_source
;
int
i_ret
;
int
i_ret
;
/* */
PreUpdateFlags
(
p_access
);
PreUpdateFlags
(
p_access
);
/* */
i_ret
=
p_src
->
pf_control
(
p_src
,
i_query
,
args
);
i_ret
=
p_src
->
pf_control
(
p_src
,
i_query
,
args
);
/* */
PostUpdateFlags
(
p_access
);
PostUpdateFlags
(
p_access
);
return
i_ret
;
return
i_ret
;
...
@@ -258,13 +246,10 @@ static int Seek( access_t *p_access, int64_t i_pos )
...
@@ -258,13 +246,10 @@ static int Seek( access_t *p_access, int64_t i_pos )
access_t
*
p_src
=
p_access
->
p_source
;
access_t
*
p_src
=
p_access
->
p_source
;
int
i_ret
;
int
i_ret
;
/* */
PreUpdateFlags
(
p_access
);
PreUpdateFlags
(
p_access
);
/* */
i_ret
=
p_src
->
pf_seek
(
p_src
,
i_pos
);
i_ret
=
p_src
->
pf_seek
(
p_src
,
i_pos
);
/* */
PostUpdateFlags
(
p_access
);
PostUpdateFlags
(
p_access
);
return
i_ret
;
return
i_ret
;
...
@@ -330,7 +315,6 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
...
@@ -330,7 +315,6 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
int
i_write
;
int
i_write
;
/* */
if
(
!
p_sys
->
b_dump
)
if
(
!
p_sys
->
b_dump
)
{
{
if
(
p_sys
->
f
)
if
(
p_sys
->
f
)
...
@@ -351,7 +335,6 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
...
@@ -351,7 +335,6 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
return
;
return
;
}
}
/* */
if
(
!
p_sys
->
f
)
if
(
!
p_sys
->
f
)
{
{
input_thread_t
*
p_input
;
input_thread_t
*
p_input
;
...
@@ -448,7 +431,6 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
...
@@ -448,7 +431,6 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
p_sys
->
i_size
=
0
;
p_sys
->
i_size
=
0
;
}
}
/* */
if
(
(
i_write
=
fwrite
(
p_buffer
,
1
,
i_buffer
,
p_sys
->
f
)
)
>
0
)
if
(
(
i_write
=
fwrite
(
p_buffer
,
1
,
i_buffer
,
p_sys
->
f
)
)
>
0
)
p_sys
->
i_size
+=
i_write
;
p_sys
->
i_size
+=
i_write
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment