Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
77fbc032
Commit
77fbc032
authored
Feb 15, 2014
by
Maxim Poliakovski
Committed by
Kostya Shishkov
Feb 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g2meet: validate bpp and bitmasks in the display info
Signed-off-by:
Kostya Shishkov
<
kostya.shishkov@gmail.com
>
parent
f58dcfb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
g2meet.c
libavcodec/g2meet.c
+21
-1
No files found.
libavcodec/g2meet.c
View file @
77fbc032
...
...
@@ -653,7 +653,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
GetByteContext
bc
,
tbc
;
int
magic
;
int
got_header
=
0
;
uint32_t
chunk_size
;
uint32_t
chunk_size
,
r_mask
,
g_mask
,
b_mask
;
int
chunk_type
,
chunk_start
;
int
i
;
int
ret
;
...
...
@@ -728,6 +728,26 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
c
->
tiles_x
=
(
c
->
width
+
c
->
tile_width
-
1
)
/
c
->
tile_width
;
c
->
tiles_y
=
(
c
->
height
+
c
->
tile_height
-
1
)
/
c
->
tile_height
;
c
->
bpp
=
bytestream2_get_byte
(
&
bc
);
if
(
c
->
bpp
==
32
)
{
if
(
bytestream2_get_bytes_left
(
&
bc
)
<
16
||
(
chunk_size
-
21
)
<
16
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Display info: missing bitmasks!
\n
"
);
return
AVERROR_INVALIDDATA
;
}
r_mask
=
bytestream2_get_be32
(
&
bc
);
g_mask
=
bytestream2_get_be32
(
&
bc
);
b_mask
=
bytestream2_get_be32
(
&
bc
);
if
(
r_mask
!=
0xFF0000
||
g_mask
!=
0xFF00
||
b_mask
!=
0xFF
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid or unsupported bitmasks: R=%X, G=%X, B=%X
\n
"
,
r_mask
,
g_mask
,
b_mask
);
return
AVERROR_PATCHWELCOME
;
}
}
else
{
avpriv_request_sample
(
avctx
,
"bpp=%d"
,
c
->
bpp
);
return
AVERROR_PATCHWELCOME
;
}
if
(
g2m_init_buffers
(
c
))
{
ret
=
AVERROR
(
ENOMEM
);
goto
header_fail
;
...
...
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