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
8affd753
Commit
8affd753
authored
Dec 10, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/gifdec: truncate too big width/height for invalid gif files
Fixes #6874.
parent
14156e60
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
gifdec.c
libavcodec/gifdec.c
+12
-4
No files found.
libavcodec/gifdec.c
View file @
8affd753
...
...
@@ -179,12 +179,20 @@ static int gif_read_image(GifState *s, AVFrame *frame)
}
/* verify that all the image is inside the screen dimensions */
if
(
!
width
||
width
>
s
->
screen_width
||
left
>=
s
->
screen_width
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Invalid image width.
\n
"
);
if
(
!
width
||
width
>
s
->
screen_width
)
{
av_log
(
s
->
avctx
,
AV_LOG_WARNING
,
"Invalid image width: %d, truncating.
\n
"
,
width
);
width
=
s
->
screen_width
;
}
if
(
left
>=
s
->
screen_width
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Invalid left position: %d.
\n
"
,
left
);
return
AVERROR_INVALIDDATA
;
}
if
(
!
height
||
height
>
s
->
screen_height
||
top
>=
s
->
screen_height
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Invalid image height.
\n
"
);
if
(
!
height
||
height
>
s
->
screen_height
)
{
av_log
(
s
->
avctx
,
AV_LOG_WARNING
,
"Invalid image height: %d, truncating.
\n
"
,
height
);
height
=
s
->
screen_height
;
}
if
(
top
>=
s
->
screen_height
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Invalid top position: %d.
\n
"
,
top
);
return
AVERROR_INVALIDDATA
;
}
if
(
left
+
width
>
s
->
screen_width
)
{
...
...
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