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
b12d92ef
Commit
b12d92ef
authored
Oct 14, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid "0xFF << 24" as it is considered a integer overflow in C99
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
d3d715ff
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
29 additions
and
29 deletions
+29
-29
avs.c
libavcodec/avs.c
+1
-1
bfi.c
libavcodec/bfi.c
+1
-1
bmv.c
libavcodec/bmv.c
+1
-1
cdgraphics.c
libavcodec/cdgraphics.c
+1
-1
dfa.c
libavcodec/dfa.c
+1
-1
dxa.c
libavcodec/dxa.c
+1
-1
eacmv.c
libavcodec/eacmv.c
+1
-1
eatgv.c
libavcodec/eatgv.c
+1
-1
flicvideo.c
libavcodec/flicvideo.c
+1
-1
jvdec.c
libavcodec/jvdec.c
+1
-1
kmvc.c
libavcodec/kmvc.c
+1
-1
mmvideo.c
libavcodec/mmvideo.c
+1
-1
mss1.c
libavcodec/mss1.c
+1
-1
mss12.c
libavcodec/mss12.c
+1
-1
pngdec.c
libavcodec/pngdec.c
+2
-2
qdrw.c
libavcodec/qdrw.c
+1
-1
rl2.c
libavcodec/rl2.c
+1
-1
sanm.c
libavcodec/sanm.c
+4
-4
smacker.c
libavcodec/smacker.c
+1
-1
tiertexseqv.c
libavcodec/tiertexseqv.c
+1
-1
tiff.c
libavcodec/tiff.c
+2
-2
vmdav.c
libavcodec/vmdav.c
+1
-1
vqavideo.c
libavcodec/vqavideo.c
+1
-1
yop.c
libavcodec/yop.c
+1
-1
No files found.
libavcodec/avs.c
View file @
b12d92ef
...
...
@@ -87,7 +87,7 @@ avs_decode_frame(AVCodecContext * avctx,
buf
+=
4
;
for
(
i
=
first
;
i
<
last
;
i
++
,
buf
+=
3
)
{
pal
[
i
]
=
(
buf
[
0
]
<<
18
)
|
(
buf
[
1
]
<<
10
)
|
(
buf
[
2
]
<<
2
);
pal
[
i
]
|=
0xFF
<<
24
|
(
pal
[
i
]
>>
6
)
&
0x30303
;
pal
[
i
]
|=
0xFF
U
<<
24
|
(
pal
[
i
]
>>
6
)
&
0x30303
;
}
sub_type
=
buf
[
0
];
...
...
libavcodec/bfi.c
View file @
b12d92ef
...
...
@@ -82,7 +82,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
pal
=
(
uint32_t
*
)
bfi
->
frame
.
data
[
1
];
for
(
i
=
0
;
i
<
avctx
->
extradata_size
/
3
;
i
++
)
{
int
shift
=
16
;
*
pal
=
0xFF
<<
24
;
*
pal
=
0xFF
U
<<
24
;
for
(
j
=
0
;
j
<
3
;
j
++
,
shift
-=
8
)
*
pal
+=
((
avctx
->
extradata
[
i
*
3
+
j
]
<<
2
)
|
(
avctx
->
extradata
[
i
*
3
+
j
]
>>
4
))
<<
shift
;
...
...
libavcodec/bmv.c
View file @
b12d92ef
...
...
@@ -227,7 +227,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
return
AVERROR_INVALIDDATA
;
}
for
(
i
=
0
;
i
<
256
;
i
++
)
c
->
pal
[
i
]
=
0xFF
<<
24
|
bytestream_get_be24
(
&
c
->
stream
);
c
->
pal
[
i
]
=
0xFF
U
<<
24
|
bytestream_get_be24
(
&
c
->
stream
);
}
if
(
type
&
BMV_SCROLL
)
{
if
(
c
->
stream
-
pkt
->
data
>
pkt
->
size
-
2
)
{
...
...
libavcodec/cdgraphics.c
View file @
b12d92ef
...
...
@@ -126,7 +126,7 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)
r
=
((
color
>>
8
)
&
0x000F
)
*
17
;
g
=
((
color
>>
4
)
&
0x000F
)
*
17
;
b
=
((
color
)
&
0x000F
)
*
17
;
palette
[
i
+
array_offset
]
=
0xFF
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
palette
[
i
+
array_offset
]
=
0xFF
U
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
}
cc
->
frame
.
palette_has_changed
=
1
;
}
...
...
libavcodec/dfa.c
View file @
b12d92ef
...
...
@@ -345,7 +345,7 @@ static int dfa_decode_frame(AVCodecContext *avctx,
pal_elems
=
FFMIN
(
chunk_size
/
3
,
256
);
for
(
i
=
0
;
i
<
pal_elems
;
i
++
)
{
s
->
pal
[
i
]
=
bytestream2_get_be24
(
&
gb
)
<<
2
;
s
->
pal
[
i
]
|=
0xFF
<<
24
|
(
s
->
pal
[
i
]
>>
6
)
&
0x30303
;
s
->
pal
[
i
]
|=
0xFF
U
<<
24
|
(
s
->
pal
[
i
]
>>
6
)
&
0x30303
;
}
s
->
pic
.
palette_has_changed
=
1
;
}
else
if
(
chunk_type
<=
9
)
{
...
...
libavcodec/dxa.c
View file @
b12d92ef
...
...
@@ -209,7 +209,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
r
=
*
buf
++
;
g
=
*
buf
++
;
b
=
*
buf
++
;
c
->
pal
[
i
]
=
0xFF
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
c
->
pal
[
i
]
=
0xFF
U
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
}
pc
=
1
;
buf_size
-=
768
+
4
;
...
...
libavcodec/eacmv.c
View file @
b12d92ef
...
...
@@ -142,7 +142,7 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t
buf
+=
16
;
for
(
i
=
pal_start
;
i
<
pal_start
+
pal_count
&&
i
<
AVPALETTE_COUNT
&&
buf_end
-
buf
>=
3
;
i
++
)
{
s
->
palette
[
i
]
=
0xFF
<<
24
|
AV_RB24
(
buf
);
s
->
palette
[
i
]
=
0xFF
U
<<
24
|
AV_RB24
(
buf
);
buf
+=
3
;
}
}
...
...
libavcodec/eatgv.c
View file @
b12d92ef
...
...
@@ -286,7 +286,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
pal_count
=
AV_RL16
(
&
buf
[
6
]);
buf
+=
12
;
for
(
i
=
0
;
i
<
pal_count
&&
i
<
AVPALETTE_COUNT
&&
buf_end
-
buf
>=
3
;
i
++
)
{
s
->
palette
[
i
]
=
0xFF
<<
24
|
AV_RB24
(
buf
);
s
->
palette
[
i
]
=
0xFF
U
<<
24
|
AV_RB24
(
buf
);
buf
+=
3
;
}
}
...
...
libavcodec/flicvideo.c
View file @
b12d92ef
...
...
@@ -256,7 +256,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
r
=
bytestream2_get_byte
(
&
g2
)
<<
color_shift
;
g
=
bytestream2_get_byte
(
&
g2
)
<<
color_shift
;
b
=
bytestream2_get_byte
(
&
g2
)
<<
color_shift
;
entry
=
0xFF
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
entry
=
0xFF
U
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
if
(
color_shift
==
2
)
entry
|=
entry
>>
6
&
0x30303
;
if
(
s
->
palette
[
palette_ptr
]
!=
entry
)
...
...
libavcodec/jvdec.c
View file @
b12d92ef
...
...
@@ -177,7 +177,7 @@ static int decode_frame(AVCodecContext *avctx,
if
(
buf_end
-
buf
>=
AVPALETTE_COUNT
*
3
)
{
for
(
i
=
0
;
i
<
AVPALETTE_COUNT
;
i
++
)
{
uint32_t
pal
=
AV_RB24
(
buf
);
s
->
palette
[
i
]
=
0xFF
<<
24
|
pal
<<
2
|
((
pal
>>
4
)
&
0x30303
);
s
->
palette
[
i
]
=
0xFF
U
<<
24
|
pal
<<
2
|
((
pal
>>
4
)
&
0x30303
);
buf
+=
3
;
}
s
->
palette_has_changed
=
1
;
...
...
libavcodec/kmvc.c
View file @
b12d92ef
...
...
@@ -389,7 +389,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
c
->
prev
=
c
->
frm1
;
for
(
i
=
0
;
i
<
256
;
i
++
)
{
c
->
pal
[
i
]
=
0xFF
<<
24
|
i
*
0x10101
;
c
->
pal
[
i
]
=
0xFF
U
<<
24
|
i
*
0x10101
;
}
if
(
avctx
->
extradata_size
<
12
)
{
...
...
libavcodec/mmvideo.c
View file @
b12d92ef
...
...
@@ -72,7 +72,7 @@ static int mm_decode_pal(MmContext *s)
bytestream2_skip
(
&
s
->
gb
,
4
);
for
(
i
=
0
;
i
<
128
;
i
++
)
{
s
->
palette
[
i
]
=
0xFF
<<
24
|
bytestream2_get_be24
(
&
s
->
gb
);
s
->
palette
[
i
]
=
0xFF
U
<<
24
|
bytestream2_get_be24
(
&
s
->
gb
);
s
->
palette
[
i
+
128
]
=
s
->
palette
[
i
]
<<
2
;
}
...
...
libavcodec/mss1.c
View file @
b12d92ef
...
...
@@ -129,7 +129,7 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
r
=
arith_get_bits
(
acoder
,
8
);
g
=
arith_get_bits
(
acoder
,
8
);
b
=
arith_get_bits
(
acoder
,
8
);
*
pal
++
=
(
0xFF
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
b
;
*
pal
++
=
(
0xFF
U
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
b
;
}
return
!!
ncol
;
...
...
libavcodec/mss12.c
View file @
b12d92ef
...
...
@@ -645,7 +645,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version,
}
for
(
i
=
0
;
i
<
256
;
i
++
)
c
->
pal
[
i
]
=
0xFF
<<
24
|
AV_RB24
(
avctx
->
extradata
+
52
+
c
->
pal
[
i
]
=
0xFF
U
<<
24
|
AV_RB24
(
avctx
->
extradata
+
52
+
(
version
?
8
:
0
)
+
i
*
3
);
c
->
mask_stride
=
FFALIGN
(
avctx
->
width
,
16
);
...
...
libavcodec/pngdec.c
View file @
b12d92ef
...
...
@@ -592,10 +592,10 @@ static int decode_frame(AVCodecContext *avctx,
r
=
bytestream2_get_byte
(
&
s
->
gb
);
g
=
bytestream2_get_byte
(
&
s
->
gb
);
b
=
bytestream2_get_byte
(
&
s
->
gb
);
s
->
palette
[
i
]
=
(
0x
ff
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
b
;
s
->
palette
[
i
]
=
(
0x
FFU
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
b
;
}
for
(;
i
<
256
;
i
++
)
{
s
->
palette
[
i
]
=
(
0x
ff
<<
24
);
s
->
palette
[
i
]
=
(
0x
FFU
<<
24
);
}
s
->
state
|=
PNG_PLTE
;
bytestream2_skip
(
&
s
->
gb
,
4
);
/* crc */
...
...
libavcodec/qdrw.c
View file @
b12d92ef
...
...
@@ -91,7 +91,7 @@ static int decode_frame(AVCodecContext *avctx,
buf
++
;
b
=
*
buf
++
;
buf
++
;
pal
[
idx
]
=
0xFF
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
pal
[
idx
]
=
0xFF
U
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
}
p
->
palette_has_changed
=
1
;
...
...
libavcodec/rl2.c
View file @
b12d92ef
...
...
@@ -154,7 +154,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx)
/** initialize palette */
for
(
i
=
0
;
i
<
AVPALETTE_COUNT
;
i
++
)
s
->
palette
[
i
]
=
0xFF
<<
24
|
AV_RB24
(
&
avctx
->
extradata
[
6
+
i
*
3
]);
s
->
palette
[
i
]
=
0xFF
U
<<
24
|
AV_RB24
(
&
avctx
->
extradata
[
6
+
i
*
3
]);
/** decode background frame if present */
back_size
=
avctx
->
extradata_size
-
EXTRADATA1_SIZE
;
...
...
libavcodec/sanm.c
View file @
b12d92ef
...
...
@@ -284,7 +284,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx
->
subversion
=
AV_RL16
(
avctx
->
extradata
);
for
(
i
=
0
;
i
<
256
;
i
++
)
ctx
->
pal
[
i
]
=
0xFF
<<
24
|
AV_RL32
(
avctx
->
extradata
+
2
+
i
*
4
);
ctx
->
pal
[
i
]
=
0xFF
U
<<
24
|
AV_RL32
(
avctx
->
extradata
+
2
+
i
*
4
);
}
return
0
;
...
...
@@ -1172,7 +1172,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return
AVERROR_INVALIDDATA
;
}
for
(
i
=
0
;
i
<
256
;
i
++
)
ctx
->
pal
[
i
]
=
0xFF
<<
24
|
bytestream2_get_be24u
(
&
ctx
->
gb
);
ctx
->
pal
[
i
]
=
0xFF
U
<<
24
|
bytestream2_get_be24u
(
&
ctx
->
gb
);
break
;
case
MKBETAG
(
'F'
,
'O'
,
'B'
,
'J'
):
if
(
size
<
16
)
...
...
@@ -1190,7 +1190,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int
t
=
(
ctx
->
pal
[
i
]
>>
(
16
-
j
*
8
))
&
0xFF
;
tmp
[
j
]
=
av_clip_uint8
((
t
*
129
+
ctx
->
delta_pal
[
i
*
3
+
j
])
>>
7
);
}
ctx
->
pal
[
i
]
=
0xFF
<<
24
|
AV_RB24
(
tmp
);
ctx
->
pal
[
i
]
=
0xFF
U
<<
24
|
AV_RB24
(
tmp
);
}
}
else
{
if
(
size
<
768
*
2
+
4
)
{
...
...
@@ -1203,7 +1203,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
ctx
->
delta_pal
[
i
]
=
bytestream2_get_le16u
(
&
ctx
->
gb
);
if
(
size
>=
768
*
5
+
4
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
ctx
->
pal
[
i
]
=
0xFF
<<
24
|
bytestream2_get_be24u
(
&
ctx
->
gb
);
ctx
->
pal
[
i
]
=
0xFF
U
<<
24
|
bytestream2_get_be24u
(
&
ctx
->
gb
);
}
else
{
memset
(
ctx
->
pal
,
0
,
sizeof
(
ctx
->
pal
));
}
...
...
libavcodec/smacker.c
View file @
b12d92ef
...
...
@@ -388,7 +388,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
smk
->
pic
.
pict_type
=
AV_PICTURE_TYPE_P
;
for
(
i
=
0
;
i
<
256
;
i
++
)
*
pal
++
=
0xFF
<<
24
|
bytestream2_get_be24u
(
&
gb2
);
*
pal
++
=
0xFF
U
<<
24
|
bytestream2_get_be24u
(
&
gb2
);
last_reset
(
smk
->
mmap_tbl
,
smk
->
mmap_last
);
last_reset
(
smk
->
mclr_tbl
,
smk
->
mclr_last
);
...
...
libavcodec/tiertexseqv.c
View file @
b12d92ef
...
...
@@ -178,7 +178,7 @@ static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int
for
(
i
=
0
;
i
<
256
;
i
++
)
{
for
(
j
=
0
;
j
<
3
;
j
++
,
data
++
)
c
[
j
]
=
(
*
data
<<
2
)
|
(
*
data
>>
4
);
palette
[
i
]
=
0xFF
<<
24
|
AV_RB24
(
c
);
palette
[
i
]
=
0xFF
U
<<
24
|
AV_RB24
(
c
);
}
seq
->
frame
.
palette_has_changed
=
1
;
}
...
...
libavcodec/tiff.c
View file @
b12d92ef
...
...
@@ -607,7 +607,7 @@ static int init_image(TiffContext *s)
/* make default grayscale pal */
pal
=
(
uint32_t
*
)
s
->
picture
.
data
[
1
];
for
(
i
=
0
;
i
<
1
<<
s
->
bpp
;
i
++
)
pal
[
i
]
=
0xFF
<<
24
|
i
*
255
/
((
1
<<
s
->
bpp
)
-
1
)
*
0x010101
;
pal
[
i
]
=
0xFF
U
<<
24
|
i
*
255
/
((
1
<<
s
->
bpp
)
-
1
)
*
0x010101
;
}
}
return
0
;
...
...
@@ -824,7 +824,7 @@ static int tiff_decode_tag(TiffContext *s)
for
(
k
=
2
;
k
>=
0
;
k
--
)
{
for
(
i
=
0
;
i
<
count
/
3
;
i
++
)
{
if
(
k
==
2
)
pal
[
i
]
=
0x
ff
<<
24
;
pal
[
i
]
=
0x
FFU
<<
24
;
j
=
(
tget
(
&
s
->
gb
,
type
,
s
->
le
)
>>
off
)
<<
(
k
*
8
);
pal
[
i
]
|=
j
;
}
...
...
libavcodec/vmdav.c
View file @
b12d92ef
...
...
@@ -265,7 +265,7 @@ static void vmd_decode(VmdVideoContext *s)
r
=
*
p
++
*
4
;
g
=
*
p
++
*
4
;
b
=
*
p
++
*
4
;
palette32
[
i
]
=
0xFF
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
palette32
[
i
]
=
0xFF
U
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
palette32
[
i
]
|=
palette32
[
i
]
>>
6
&
0x30303
;
}
}
...
...
libavcodec/vqavideo.c
View file @
b12d92ef
...
...
@@ -416,7 +416,7 @@ static int vqa_decode_chunk(VqaContext *s)
r
=
bytestream2_get_byteu
(
&
s
->
gb
)
*
4
;
g
=
bytestream2_get_byteu
(
&
s
->
gb
)
*
4
;
b
=
bytestream2_get_byteu
(
&
s
->
gb
)
*
4
;
s
->
palette
[
i
]
=
0xFF
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
s
->
palette
[
i
]
=
0xFF
U
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
s
->
palette
[
i
]
|=
s
->
palette
[
i
]
>>
6
&
0x30303
;
}
}
...
...
libavcodec/yop.c
View file @
b12d92ef
...
...
@@ -235,7 +235,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
palette
[
i
+
firstcolor
]
=
(
s
->
srcptr
[
0
]
<<
18
)
|
(
s
->
srcptr
[
1
]
<<
10
)
|
(
s
->
srcptr
[
2
]
<<
2
);
palette
[
i
+
firstcolor
]
|=
0xFF
<<
24
|
palette
[
i
+
firstcolor
]
|=
0xFF
U
<<
24
|
(
palette
[
i
+
firstcolor
]
>>
6
)
&
0x30303
;
}
...
...
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