Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
b3b751cb
Commit
b3b751cb
authored
Oct 14, 2012
by
Edward Wang
Committed by
Jean-Baptiste Kempf
Oct 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
png: Check length before read
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
72628474
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
modules/codec/png.c
modules/codec/png.c
+5
-3
No files found.
modules/codec/png.c
View file @
b3b751cb
...
...
@@ -91,12 +91,14 @@ static int OpenDecoder( vlc_object_t *p_this )
static
void
user_read
(
png_structp
p_png
,
png_bytep
data
,
png_size_t
i_length
)
{
block_t
*
p_block
=
(
block_t
*
)
png_get_io_ptr
(
p_png
);
png_size_t
i_read
=
__MIN
(
p_block
->
i_buffer
,
i_length
);
if
(
i_length
>
p_block
->
i_buffer
)
{
png_error
(
p_png
,
"not enough data"
);
return
;
}
memcpy
(
data
,
p_block
->
p_buffer
,
i_length
);
p_block
->
p_buffer
+=
i_length
;
p_block
->
i_buffer
-=
i_length
;
if
(
i_length
!=
i_read
)
png_error
(
p_png
,
"not enough data"
);
}
static
void
user_error
(
png_structp
p_png
,
png_const_charp
error_msg
)
...
...
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