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
5b5ed92d
Commit
5b5ed92d
authored
Aug 26, 2016
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sanm: Change type of array pitch parameters to ptrdiff_t
ptrdiff_t is the correct type for array pitches and similar.
parent
73f5e17a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
sanm.c
libavcodec/sanm.c
+11
-11
No files found.
libavcodec/sanm.c
View file @
5b5ed92d
...
@@ -217,7 +217,7 @@ typedef struct SANMVideoContext {
...
@@ -217,7 +217,7 @@ typedef struct SANMVideoContext {
uint32_t
pal
[
PALETTE_SIZE
];
uint32_t
pal
[
PALETTE_SIZE
];
int16_t
delta_pal
[
PALETTE_DELTA
];
int16_t
delta_pal
[
PALETTE_DELTA
];
in
t
pitch
;
ptrdiff_
t
pitch
;
int
width
,
height
;
int
width
,
height
;
int
aligned_width
,
aligned_height
;
int
aligned_width
,
aligned_height
;
int
prev_seq
;
int
prev_seq
;
...
@@ -571,7 +571,7 @@ static inline void codec37_mv(uint8_t *dst, const uint8_t *src,
...
@@ -571,7 +571,7 @@ static inline void codec37_mv(uint8_t *dst, const uint8_t *src,
static
int
old_codec37
(
SANMVideoContext
*
ctx
,
int
top
,
static
int
old_codec37
(
SANMVideoContext
*
ctx
,
int
top
,
int
left
,
int
width
,
int
height
)
int
left
,
int
width
,
int
height
)
{
{
in
t
stride
=
ctx
->
pitch
;
ptrdiff_
t
stride
=
ctx
->
pitch
;
int
i
,
j
,
k
,
t
;
int
i
,
j
,
k
,
t
;
uint8_t
*
dst
,
*
prev
;
uint8_t
*
dst
,
*
prev
;
int
skip_run
=
0
;
int
skip_run
=
0
;
...
@@ -809,7 +809,7 @@ static int old_codec47(SANMVideoContext *ctx, int top,
...
@@ -809,7 +809,7 @@ static int old_codec47(SANMVideoContext *ctx, int top,
{
{
uint32_t
decoded_size
;
uint32_t
decoded_size
;
int
i
,
j
;
int
i
,
j
;
int
stride
=
ctx
->
pitch
;
ptrdiff_t
stride
=
ctx
->
pitch
;
uint8_t
*
dst
=
(
uint8_t
*
)
ctx
->
frm0
+
left
+
top
*
stride
;
uint8_t
*
dst
=
(
uint8_t
*
)
ctx
->
frm0
+
left
+
top
*
stride
;
uint8_t
*
prev1
=
(
uint8_t
*
)
ctx
->
frm1
;
uint8_t
*
prev1
=
(
uint8_t
*
)
ctx
->
frm1
;
uint8_t
*
prev2
=
(
uint8_t
*
)
ctx
->
frm2
;
uint8_t
*
prev2
=
(
uint8_t
*
)
ctx
->
frm2
;
...
@@ -962,11 +962,11 @@ static int decode_nop(SANMVideoContext *ctx)
...
@@ -962,11 +962,11 @@ static int decode_nop(SANMVideoContext *ctx)
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
static
void
copy_block
(
uint16_t
*
pdest
,
uint16_t
*
psrc
,
int
block_size
,
in
t
pitch
)
static
void
copy_block
(
uint16_t
*
pdest
,
uint16_t
*
psrc
,
int
block_size
,
ptrdiff_
t
pitch
)
{
{
uint8_t
*
dst
=
(
uint8_t
*
)
pdest
;
uint8_t
*
dst
=
(
uint8_t
*
)
pdest
;
uint8_t
*
src
=
(
uint8_t
*
)
psrc
;
uint8_t
*
src
=
(
uint8_t
*
)
psrc
;
in
t
stride
=
pitch
*
2
;
ptrdiff_
t
stride
=
pitch
*
2
;
switch
(
block_size
)
{
switch
(
block_size
)
{
case
2
:
case
2
:
...
@@ -981,7 +981,7 @@ static void copy_block(uint16_t *pdest, uint16_t *psrc, int block_size, int pitc
...
@@ -981,7 +981,7 @@ static void copy_block(uint16_t *pdest, uint16_t *psrc, int block_size, int pitc
}
}
}
}
static
void
fill_block
(
uint16_t
*
pdest
,
uint16_t
color
,
int
block_size
,
in
t
pitch
)
static
void
fill_block
(
uint16_t
*
pdest
,
uint16_t
color
,
int
block_size
,
ptrdiff_
t
pitch
)
{
{
int
x
,
y
;
int
x
,
y
;
...
@@ -993,7 +993,7 @@ static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitc
...
@@ -993,7 +993,7 @@ static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitc
static
int
draw_glyph
(
SANMVideoContext
*
ctx
,
uint16_t
*
dst
,
int
index
,
static
int
draw_glyph
(
SANMVideoContext
*
ctx
,
uint16_t
*
dst
,
int
index
,
uint16_t
fg_color
,
uint16_t
bg_color
,
int
block_size
,
uint16_t
fg_color
,
uint16_t
bg_color
,
int
block_size
,
in
t
pitch
)
ptrdiff_
t
pitch
)
{
{
int8_t
*
pglyph
;
int8_t
*
pglyph
;
uint16_t
colors
[
2
]
=
{
fg_color
,
bg_color
};
uint16_t
colors
[
2
]
=
{
fg_color
,
bg_color
};
...
@@ -1013,7 +1013,7 @@ static int draw_glyph(SANMVideoContext *ctx, uint16_t *dst, int index,
...
@@ -1013,7 +1013,7 @@ static int draw_glyph(SANMVideoContext *ctx, uint16_t *dst, int index,
return
0
;
return
0
;
}
}
static
int
opcode_0xf7
(
SANMVideoContext
*
ctx
,
int
cx
,
int
cy
,
int
block_size
,
in
t
pitch
)
static
int
opcode_0xf7
(
SANMVideoContext
*
ctx
,
int
cx
,
int
cy
,
int
block_size
,
ptrdiff_
t
pitch
)
{
{
uint16_t
*
dst
=
ctx
->
frm0
+
cx
+
cy
*
ctx
->
pitch
;
uint16_t
*
dst
=
ctx
->
frm0
+
cx
+
cy
*
ctx
->
pitch
;
...
@@ -1047,7 +1047,7 @@ static int opcode_0xf7(SANMVideoContext *ctx, int cx, int cy, int block_size, in
...
@@ -1047,7 +1047,7 @@ static int opcode_0xf7(SANMVideoContext *ctx, int cx, int cy, int block_size, in
return
0
;
return
0
;
}
}
static
int
opcode_0xf8
(
SANMVideoContext
*
ctx
,
int
cx
,
int
cy
,
int
block_size
,
in
t
pitch
)
static
int
opcode_0xf8
(
SANMVideoContext
*
ctx
,
int
cx
,
int
cy
,
int
block_size
,
ptrdiff_
t
pitch
)
{
{
uint16_t
*
dst
=
ctx
->
frm0
+
cx
+
cy
*
ctx
->
pitch
;
uint16_t
*
dst
=
ctx
->
frm0
+
cx
+
cy
*
ctx
->
pitch
;
...
@@ -1317,8 +1317,8 @@ static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr)
...
@@ -1317,8 +1317,8 @@ static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr)
{
{
uint8_t
*
dst
;
uint8_t
*
dst
;
const
uint8_t
*
src
=
(
uint8_t
*
)
ctx
->
frm0
;
const
uint8_t
*
src
=
(
uint8_t
*
)
ctx
->
frm0
;
int
ret
,
dstpitch
,
height
=
ctx
->
height
;
int
ret
,
height
=
ctx
->
height
;
int
srcpitch
=
ctx
->
pitch
*
(
hdr
?
sizeof
(
ctx
->
frm0
[
0
])
:
1
);
ptrdiff_t
dstpitch
,
srcpitch
=
ctx
->
pitch
*
(
hdr
?
sizeof
(
ctx
->
frm0
[
0
])
:
1
);
if
((
ret
=
ff_get_buffer
(
ctx
->
avctx
,
ctx
->
frame
,
0
))
<
0
)
if
((
ret
=
ff_get_buffer
(
ctx
->
avctx
,
ctx
->
frame
,
0
))
<
0
)
return
ret
;
return
ret
;
...
...
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