Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
e1065924
Commit
e1065924
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
qtrle: add more checks against pixel_ptr being negative.
CC:libav-stable@libav.org
parent
4f3b058c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/qtrle.c
+5
-0
5 additions, 0 deletions
libavcodec/qtrle.c
with
5 additions
and
0 deletions
libavcodec/qtrle.c
+
5
−
0
View file @
e1065924
...
...
@@ -117,6 +117,7 @@ static inline void qtrle_decode_2n4bpp(QtrleContext *s, int row_ptr,
while
(
lines_to_change
--
)
{
pixel_ptr
=
row_ptr
+
(
num_pixels
*
(
bytestream2_get_byte
(
&
s
->
g
)
-
1
));
CHECK_PIXEL_PTR
(
0
);
while
((
rle_code
=
(
signed
char
)
bytestream2_get_byte
(
&
s
->
g
))
!=
-
1
)
{
if
(
rle_code
==
0
)
{
...
...
@@ -171,6 +172,7 @@ static void qtrle_decode_8bpp(QtrleContext *s, int row_ptr, int lines_to_change)
while
(
lines_to_change
--
)
{
pixel_ptr
=
row_ptr
+
(
4
*
(
bytestream2_get_byte
(
&
s
->
g
)
-
1
));
CHECK_PIXEL_PTR
(
0
);
while
((
rle_code
=
(
signed
char
)
bytestream2_get_byte
(
&
s
->
g
))
!=
-
1
)
{
if
(
rle_code
==
0
)
{
...
...
@@ -220,6 +222,7 @@ static void qtrle_decode_16bpp(QtrleContext *s, int row_ptr, int lines_to_change
while
(
lines_to_change
--
)
{
pixel_ptr
=
row_ptr
+
(
bytestream2_get_byte
(
&
s
->
g
)
-
1
)
*
2
;
CHECK_PIXEL_PTR
(
0
);
while
((
rle_code
=
(
signed
char
)
bytestream2_get_byte
(
&
s
->
g
))
!=
-
1
)
{
if
(
rle_code
==
0
)
{
...
...
@@ -263,6 +266,7 @@ static void qtrle_decode_24bpp(QtrleContext *s, int row_ptr, int lines_to_change
while
(
lines_to_change
--
)
{
pixel_ptr
=
row_ptr
+
(
bytestream2_get_byte
(
&
s
->
g
)
-
1
)
*
3
;
CHECK_PIXEL_PTR
(
0
);
while
((
rle_code
=
(
signed
char
)
bytestream2_get_byte
(
&
s
->
g
))
!=
-
1
)
{
if
(
rle_code
==
0
)
{
...
...
@@ -309,6 +313,7 @@ static void qtrle_decode_32bpp(QtrleContext *s, int row_ptr, int lines_to_change
while
(
lines_to_change
--
)
{
pixel_ptr
=
row_ptr
+
(
bytestream2_get_byte
(
&
s
->
g
)
-
1
)
*
4
;
CHECK_PIXEL_PTR
(
0
);
while
((
rle_code
=
(
signed
char
)
bytestream2_get_byte
(
&
s
->
g
))
!=
-
1
)
{
if
(
rle_code
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment