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
fe4fa8c9
Commit
fe4fa8c9
authored
Oct 20, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rawvideo: remove negative video height, signed overflow
parent
96f2bbe6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
66 deletions
+11
-66
modules/codec/rawvideo.c
modules/codec/rawvideo.c
+11
-66
No files found.
modules/codec/rawvideo.c
View file @
fe4fa8c9
...
@@ -40,8 +40,6 @@ struct decoder_sys_t
...
@@ -40,8 +40,6 @@ struct decoder_sys_t
/*
/*
* Input properties
* Input properties
*/
*/
bool
b_invert
;
size_t
size
;
size_t
size
;
unsigned
pitches
[
PICTURE_PLANE_MAX
];
unsigned
pitches
[
PICTURE_PLANE_MAX
];
unsigned
lines
[
PICTURE_PLANE_MAX
];
unsigned
lines
[
PICTURE_PLANE_MAX
];
...
@@ -97,13 +95,6 @@ static int OpenCommon( decoder_t *p_dec )
...
@@ -97,13 +95,6 @@ static int OpenCommon( decoder_t *p_dec )
if
(
unlikely
(
p_sys
==
NULL
)
)
if
(
unlikely
(
p_sys
==
NULL
)
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
if
(
(
int
)
p_dec
->
fmt_in
.
video
.
i_height
<
0
)
{
/* Frames are coded from bottom to top */
p_dec
->
fmt_in
.
video
.
i_height
=
(
unsigned
int
)(
-
(
int
)
p_dec
->
fmt_in
.
video
.
i_height
);
p_sys
->
b_invert
=
true
;
}
if
(
!
p_dec
->
fmt_in
.
video
.
i_visible_width
)
if
(
!
p_dec
->
fmt_in
.
video
.
i_visible_width
)
p_dec
->
fmt_in
.
video
.
i_visible_width
=
p_dec
->
fmt_in
.
video
.
i_width
;
p_dec
->
fmt_in
.
video
.
i_visible_width
=
p_dec
->
fmt_in
.
video
.
i_width
;
if
(
!
p_dec
->
fmt_in
.
video
.
i_visible_height
)
if
(
!
p_dec
->
fmt_in
.
video
.
i_visible_height
)
...
@@ -195,23 +186,6 @@ static void FillPicture( decoder_t *p_dec, block_t *p_block, picture_t *p_pic )
...
@@ -195,23 +186,6 @@ static void FillPicture( decoder_t *p_dec, block_t *p_block, picture_t *p_pic )
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
const
uint8_t
*
p_src
=
p_block
->
p_buffer
;
const
uint8_t
*
p_src
=
p_block
->
p_buffer
;
if
(
p_sys
->
b_invert
)
for
(
int
i
=
0
;
i
<
p_pic
->
i_planes
;
i
++
)
{
uint8_t
*
p_dst
=
p_pic
->
p
[
i
].
p_pixels
+
(
p_pic
->
p
[
i
].
i_pitch
*
p_pic
->
p
[
i
].
i_visible_lines
);
for
(
int
x
=
0
;
x
<
p_pic
->
p
[
i
].
i_visible_lines
;
x
++
)
{
p_dst
-=
p_pic
->
p
[
i
].
i_pitch
;
memcpy
(
p_dst
,
p_src
,
p_pic
->
p
[
i
].
i_visible_pitch
);
p_src
+=
p_sys
->
pitches
[
i
];
}
p_src
+=
p_sys
->
pitches
[
i
]
*
(
p_sys
->
lines
[
i
]
-
p_pic
->
p
[
i
].
i_visible_lines
);
}
else
for
(
int
i
=
0
;
i
<
p_pic
->
i_planes
;
i
++
)
for
(
int
i
=
0
;
i
<
p_pic
->
i_planes
;
i
++
)
{
{
uint8_t
*
p_dst
=
p_pic
->
p
[
i
].
p_pixels
;
uint8_t
*
p_dst
=
p_pic
->
p
[
i
].
p_pixels
;
...
@@ -293,35 +267,6 @@ static block_t *SendFrame( decoder_t *p_dec, block_t **pp_block )
...
@@ -293,35 +267,6 @@ static block_t *SendFrame( decoder_t *p_dec, block_t **pp_block )
/* Date management: 1 frame per packet */
/* Date management: 1 frame per packet */
p_block
->
i_dts
=
p_block
->
i_pts
=
date_Get
(
&
p_sys
->
pts
);
p_block
->
i_dts
=
p_block
->
i_pts
=
date_Get
(
&
p_sys
->
pts
);
date_Increment
(
&
p_sys
->
pts
,
1
);
date_Increment
(
&
p_sys
->
pts
,
1
);
if
(
p_sys
->
b_invert
)
{
block_t
*
out
=
block_Alloc
(
p_block
->
i_buffer
);
if
(
likely
(
out
!=
NULL
)
)
{
block_CopyProperties
(
out
,
p_block
);
const
uint8_t
*
p_src
=
p_block
->
p_buffer
;
uint8_t
*
p_pixels
=
out
->
p_buffer
;
for
(
unsigned
i
=
0
;
i
<
PICTURE_PLANE_MAX
;
i
++
)
{
unsigned
pitch
=
p_sys
->
pitches
[
i
];
unsigned
lines
=
p_sys
->
lines
[
i
];
uint8_t
*
p_dst
=
p_pixels
+
(
pitch
*
lines
);
for
(
unsigned
x
=
0
;
x
<
lines
;
x
++
)
{
p_dst
-=
p_sys
->
pitches
[
i
];
memcpy
(
p_dst
,
p_src
,
p_sys
->
pitches
[
i
]
);
p_src
+=
p_sys
->
pitches
[
i
];
}
}
}
block_Release
(
p_block
);
p_block
=
out
;
}
return
p_block
;
return
p_block
;
}
}
...
...
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