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
f3f48842
Commit
f3f48842
authored
Dec 01, 2011
by
Peter Ross
Committed by
Michael Niedermayer
Dec 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pictordec: prevent segfault when reading corrupted files
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
43a2a8b4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
pictordec.c
libavcodec/pictordec.c
+2
-4
No files found.
libavcodec/pictordec.c
View file @
f3f48842
...
...
@@ -202,13 +202,13 @@ static int decode_frame(AVCodecContext *avctx,
y
=
s
->
height
-
1
;
plane
=
0
;
if
(
bytestream_get_le16
(
&
buf
))
{
while
(
buf_end
-
buf
>=
6
)
{
while
(
y
>=
0
&&
buf_end
-
buf
>=
6
)
{
const
uint8_t
*
buf_pend
=
buf
+
FFMIN
(
AV_RL16
(
buf
),
buf_end
-
buf
);
//ignore uncompressed block size reported at buf[2]
int
marker
=
buf
[
4
];
buf
+=
5
;
while
(
plane
<
s
->
nb_planes
&&
buf_pend
-
buf
>=
1
)
{
while
(
plane
<
s
->
nb_planes
&&
y
>=
0
&&
buf_pend
-
buf
>=
1
)
{
int
run
=
1
;
int
val
=
*
buf
++
;
if
(
val
==
marker
)
{
...
...
@@ -222,8 +222,6 @@ static int decode_frame(AVCodecContext *avctx,
if
(
bits_per_plane
==
8
)
{
picmemset_8bpp
(
s
,
val
,
run
,
&
x
,
&
y
);
if
(
y
<
0
)
break
;
}
else
{
picmemset
(
s
,
val
,
run
,
&
x
,
&
y
,
&
plane
,
bits_per_plane
);
}
...
...
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