Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
450
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
b4667ef7
Commit
b4667ef7
authored
7 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
real: handle I/O errors
parent
8ee3ab51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/demux/real.c
+13
-8
13 additions, 8 deletions
modules/demux/real.c
with
13 additions
and
8 deletions
modules/demux/real.c
+
13
−
8
View file @
b4667ef7
...
...
@@ -964,7 +964,7 @@ static int ControlSeekByte( demux_t *p_demux, int64_t i_bytes )
*****************************************************************************/
/**
* This function will read a
p
ascal string with size stored in 2 bytes from
* This function will read a
P
ascal string with size stored in 2 bytes from
* a stream_t.
*
* FIXME what is the right charset ?
...
...
@@ -980,12 +980,18 @@ static char *StreamReadString2( stream_t *s )
if
(
i_length
<=
0
)
return
NULL
;
char
*
psz_string
=
xcalloc
(
1
,
i_length
+
1
);
char
*
psz_string
=
malloc
(
i_length
+
1
);
if
(
unlikely
(
psz_string
==
NULL
)
)
return
NULL
;
vlc_stream_Read
(
s
,
psz_string
,
i_length
);
/* Valid even if !psz_string */
if
(
vlc_stream_Read
(
s
,
psz_string
,
i_length
)
<
i_length
)
{
free
(
psz_string
);
return
NULL
;
}
if
(
psz_string
)
EnsureUTF8
(
psz_string
);
psz_string
[
i_length
]
=
'\0'
;
EnsureUTF8
(
psz_string
);
return
psz_string
;
}
...
...
@@ -1199,9 +1205,8 @@ static void HeaderINDX( demux_t *p_demux )
if
(
p_sys
->
i_index_offset
==
0
)
return
;
vlc_stream_Seek
(
p_demux
->
s
,
p_sys
->
i_index_offset
);
if
(
vlc_stream_Read
(
p_demux
->
s
,
buffer
,
20
)
<
20
)
if
(
vlc_stream_Seek
(
p_demux
->
s
,
p_sys
->
i_index_offset
)
||
vlc_stream_Read
(
p_demux
->
s
,
buffer
,
20
)
<
20
)
return
;
const
uint32_t
i_id
=
VLC_FOURCC
(
buffer
[
0
],
buffer
[
1
],
buffer
[
2
],
buffer
[
3
]
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment