Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
65f89dcc
Commit
65f89dcc
authored
Aug 20, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
real: Fix unsigned issues, and fix an overflow that could happen in release build.
parent
13268071
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
modules/demux/real.c
modules/demux/real.c
+7
-9
No files found.
modules/demux/real.c
View file @
65f89dcc
...
@@ -135,7 +135,7 @@ struct demux_sys_t
...
@@ -135,7 +135,7 @@ struct demux_sys_t
int
i_track
;
int
i_track
;
real_track_t
**
track
;
real_track_t
**
track
;
in
t
i_buffer
;
size_
t
i_buffer
;
uint8_t
buffer
[
65536
];
uint8_t
buffer
[
65536
];
int64_t
i_pcr
;
int64_t
i_pcr
;
...
@@ -299,21 +299,18 @@ static int Demux( demux_t *p_demux )
...
@@ -299,21 +299,18 @@ static int Demux( demux_t *p_demux )
if
(
stream_Read
(
p_demux
->
s
,
header
,
12
)
<
12
)
if
(
stream_Read
(
p_demux
->
s
,
header
,
12
)
<
12
)
return
0
;
return
0
;
//const int i_version = GetWBE( &header[0] );
//const int i_version = GetWBE( &header[0] );
const
int
i_size
=
GetWBE
(
&
header
[
2
]
)
-
12
;
const
size_t
i_size
=
GetWBE
(
&
header
[
2
]
)
-
12
;
const
int
i_id
=
GetWBE
(
&
header
[
4
]
);
const
int
i_id
=
GetWBE
(
&
header
[
4
]
);
const
int64_t
i_pts
=
1
+
1000
*
GetDWBE
(
&
header
[
6
]
);
const
int64_t
i_pts
=
1
+
1000
*
GetDWBE
(
&
header
[
6
]
);
const
int
i_flags
=
header
[
11
];
/* flags 0x02 -> keyframe */
const
int
i_flags
=
header
[
11
];
/* flags 0x02 -> keyframe */
p_sys
->
i_data_packets
++
;
p_sys
->
i_data_packets
++
;
if
(
i_size
>
sizeof
(
p_sys
->
buffer
)
)
if
(
i_size
<=
0
)
{
{
msg_Err
(
p_demux
,
"Got a NUKK size to read. (Invalid format?)"
);
msg_Err
(
p_demux
,
"Got a NUKK size to read. (Invalid format?)"
);
return
1
;
return
1
;
}
}
assert
(
i_size
<=
sizeof
(
p_sys
->
buffer
)
);
p_sys
->
i_buffer
=
stream_Read
(
p_demux
->
s
,
p_sys
->
buffer
,
i_size
);
p_sys
->
i_buffer
=
stream_Read
(
p_demux
->
s
,
p_sys
->
buffer
,
i_size
);
if
(
p_sys
->
i_buffer
<
i_size
)
if
(
p_sys
->
i_buffer
<
i_size
)
return
0
;
return
0
;
...
@@ -729,13 +726,13 @@ static void DemuxAudioMethod2( demux_t *p_demux, real_track_t *tk, mtime_t i_pts
...
@@ -729,13 +726,13 @@ static void DemuxAudioMethod2( demux_t *p_demux, real_track_t *tk, mtime_t i_pts
if
(
p_sys
->
i_buffer
<
2
)
if
(
p_sys
->
i_buffer
<
2
)
return
;
return
;
int
i_sub
=
(
p_sys
->
buffer
[
1
]
>>
4
)
&
0x0f
;
unsigned
i_sub
=
(
p_sys
->
buffer
[
1
]
>>
4
)
&
0x0f
;
if
(
p_sys
->
i_buffer
<
2
+
2
*
i_sub
)
if
(
p_sys
->
i_buffer
<
2
+
2
*
i_sub
)
return
;
return
;
uint8_t
*
p_sub
=
&
p_sys
->
buffer
[
2
+
2
*
i_sub
];
uint8_t
*
p_sub
=
&
p_sys
->
buffer
[
2
+
2
*
i_sub
];
for
(
int
i
=
0
;
i
<
i_sub
;
i
++
)
for
(
unsigned
i
=
0
;
i
<
i_sub
;
i
++
)
{
{
const
int
i_sub_size
=
GetWBE
(
&
p_sys
->
buffer
[
2
+
i
*
2
]
);
const
int
i_sub_size
=
GetWBE
(
&
p_sys
->
buffer
[
2
+
i
*
2
]
);
block_t
*
p_block
=
block_New
(
p_demux
,
i_sub_size
);
block_t
*
p_block
=
block_New
(
p_demux
,
i_sub_size
);
...
@@ -1060,7 +1057,8 @@ static int HeaderMDPR( demux_t *p_demux )
...
@@ -1060,7 +1057,8 @@ static int HeaderMDPR( demux_t *p_demux )
if
(
i_size
>
0
)
if
(
i_size
>
0
)
{
{
CodecParse
(
p_demux
,
i_size
,
i_num
);
CodecParse
(
p_demux
,
i_size
,
i_num
);
if
(
stream_Read
(
p_demux
->
s
,
NULL
,
i_size
)
<
i_size
)
unsigned
size
=
stream_Read
(
p_demux
->
s
,
NULL
,
i_size
);
if
(
size
<
i_size
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
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