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
767ae86c
Commit
767ae86c
authored
Jun 11, 2013
by
Kostya Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g2meet: reset dimensions on header parsing errors
parent
84d3ff50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
g2meet.c
libavcodec/g2meet.c
+12
-5
No files found.
libavcodec/g2meet.c
View file @
767ae86c
...
...
@@ -646,8 +646,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid frame dimensions %dx%d
\n
"
,
c
->
width
,
c
->
height
);
c
->
width
=
c
->
height
=
0
;
bytestream2_skip
(
&
bc
,
bytestream2_get_bytes_left
(
&
bc
))
;
ret
=
AVERROR_INVALIDDATA
;
goto
header_fail
;
}
if
(
c
->
width
!=
avctx
->
width
||
c
->
height
!=
avctx
->
height
)
avcodec_set_dimensions
(
avctx
,
c
->
width
,
c
->
height
);
...
...
@@ -664,15 +664,18 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid tile dimensions %dx%d
\n
"
,
c
->
tile_width
,
c
->
tile_height
);
return
AVERROR_INVALIDDATA
;
ret
=
AVERROR_INVALIDDATA
;
goto
header_fail
;
}
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
);
chunk_size
-=
21
;
bytestream2_skip
(
&
bc
,
chunk_size
);
if
(
g2m_init_buffers
(
c
))
return
AVERROR
(
ENOMEM
);
if
(
g2m_init_buffers
(
c
))
{
ret
=
AVERROR
(
ENOMEM
);
goto
header_fail
;
}
got_header
=
1
;
break
;
case
TILE_DATA
:
...
...
@@ -778,6 +781,10 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
return
buf_size
;
header_fail:
c
->
width
=
c
->
height
=
0
;
c
->
tiles_x
=
c
->
tiles_y
=
0
;
return
ret
;
}
static
av_cold
int
g2m_decode_init
(
AVCodecContext
*
avctx
)
...
...
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