Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
cc965300
Commit
cc965300
authored
Mar 23, 2012
by
Aneesh Dogra
Committed by
Justin Ruggles
Mar 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunrast: Add support for negative linesize.
Signed-off-by:
Justin Ruggles
<
justin.ruggles@gmail.com
>
parent
14ba7472
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
sunrastenc.c
libavcodec/sunrastenc.c
+7
-4
No files found.
libavcodec/sunrastenc.c
View file @
cc965300
...
@@ -83,15 +83,18 @@ static void sunrast_image_write_image(AVCodecContext *avctx,
...
@@ -83,15 +83,18 @@ static void sunrast_image_write_image(AVCodecContext *avctx,
if
(
s
->
type
==
RT_BYTE_ENCODED
)
{
if
(
s
->
type
==
RT_BYTE_ENCODED
)
{
uint8_t
value
,
value2
;
uint8_t
value
,
value2
;
int
run
;
int
run
;
const
uint8_t
*
end
=
pixels
+
avctx
->
height
*
linesize
;
const
uint8_t
*
start
=
linesize
<
0
?
pixels
+
(
avctx
->
height
-
1
)
*
linesize
:
pixels
;
const
uint8_t
*
end
=
linesize
<
0
?
pixels
-
linesize
:
pixels
+
avctx
->
height
*
linesize
;
ptr
=
pixels
;
ptr
=
pixels
;
#define GET_VALUE ptr >= end ? 0 : x >= len ? ptr[len-1] : ptr[x]
#define GET_VALUE ptr >= end
|| ptr < start
? 0 : x >= len ? ptr[len-1] : ptr[x]
x
=
0
;
x
=
0
;
value2
=
GET_VALUE
;
value2
=
GET_VALUE
;
while
(
ptr
<
end
)
{
while
(
ptr
<
end
&&
ptr
>=
start
)
{
run
=
1
;
run
=
1
;
value
=
value2
;
value
=
value2
;
x
++
;
x
++
;
...
@@ -101,7 +104,7 @@ static void sunrast_image_write_image(AVCodecContext *avctx,
...
@@ -101,7 +104,7 @@ static void sunrast_image_write_image(AVCodecContext *avctx,
}
}
value2
=
GET_VALUE
;
value2
=
GET_VALUE
;
while
(
value2
==
value
&&
run
<
256
&&
ptr
<
end
)
{
while
(
value2
==
value
&&
run
<
256
&&
ptr
<
end
&&
ptr
>=
start
)
{
x
++
;
x
++
;
run
++
;
run
++
;
if
(
x
>=
alen
)
{
if
(
x
>=
alen
)
{
...
...
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