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
7a28b771
Commit
7a28b771
authored
Mar 24, 2007
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some length checks
Originally committed as revision 8501 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
5f7ab90a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
gifdec.c
libavcodec/gifdec.c
+8
-1
No files found.
libavcodec/gifdec.c
View file @
7a28b771
...
...
@@ -48,6 +48,7 @@ typedef struct GifState {
/* LZW compatible decoder */
uint8_t
*
bytestream
;
uint8_t
*
bytestream_end
;
LZWState
*
lzw
;
/* aux buffers */
...
...
@@ -209,6 +210,9 @@ static int gif_read_header1(GifState *s)
int
v
,
n
;
int
has_global_palette
;
if
(
s
->
bytestream_end
<
s
->
bytestream
+
13
)
return
-
1
;
/* read gif signature */
bytestream_get_buffer
(
&
s
->
bytestream
,
sig
,
6
);
if
(
memcmp
(
sig
,
gif87a_sig
,
6
)
!=
0
&&
...
...
@@ -238,6 +242,8 @@ static int gif_read_header1(GifState *s)
#endif
if
(
has_global_palette
)
{
n
=
1
<<
s
->
bits_per_pixel
;
if
(
s
->
bytestream_end
<
s
->
bytestream
+
n
*
3
)
return
-
1
;
bytestream_get_buffer
(
&
s
->
bytestream
,
s
->
global_palette
,
n
*
3
);
}
return
0
;
...
...
@@ -245,7 +251,7 @@ static int gif_read_header1(GifState *s)
static
int
gif_parse_next_image
(
GifState
*
s
)
{
for
(;;
)
{
while
(
s
->
bytestream
<
s
->
bytestream_end
)
{
int
code
=
bytestream_get_byte
(
&
s
->
bytestream
);
#ifdef DEBUG
dprintf
(
s
->
avctx
,
"gif: code=%02x '%c'
\n
"
,
code
,
code
);
...
...
@@ -289,6 +295,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, u
int
ret
;
s
->
bytestream
=
buf
;
s
->
bytestream_end
=
buf
+
buf_size
;
if
(
gif_read_header1
(
s
)
<
0
)
return
-
1
;
...
...
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