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
158f189f
Commit
158f189f
authored
Apr 09, 2009
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorize check of read symbols.
Originally committed as revision 18390 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
a7943566
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
snow.c
libavcodec/snow.c
+11
-10
No files found.
libavcodec/snow.c
View file @
158f189f
...
...
@@ -3553,6 +3553,14 @@ static void decode_qlogs(SnowContext *s){
}
}
#define GET_S(dst, check) \
tmp= get_symbol(&s->c, s->header_state, 0);\
if(!(check)){\
av_log(s->avctx, AV_LOG_ERROR, "Error " #dst " is %d\n", tmp);\
return -1;\
}\
dst= tmp;
static
int
decode_header
(
SnowContext
*
s
){
int
plane_index
,
tmp
;
uint8_t
kstate
[
32
];
...
...
@@ -3570,10 +3578,7 @@ static int decode_header(SnowContext *s){
}
if
(
s
->
keyframe
){
s
->
version
=
get_symbol
(
&
s
->
c
,
s
->
header_state
,
0
);
if
(
s
->
version
>
0
){
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"version %d not supported"
,
s
->
version
);
return
-
1
;
}
GET_S
(
s
->
version
,
tmp
<=
0U
)
s
->
always_reset
=
get_rac
(
&
s
->
c
,
s
->
header_state
);
s
->
temporal_decomposition_type
=
get_symbol
(
&
s
->
c
,
s
->
header_state
,
0
);
s
->
temporal_decomposition_count
=
get_symbol
(
&
s
->
c
,
s
->
header_state
,
0
);
...
...
@@ -3583,12 +3588,8 @@ static int decode_header(SnowContext *s){
s
->
chroma_v_shift
=
get_symbol
(
&
s
->
c
,
s
->
header_state
,
0
);
s
->
spatial_scalability
=
get_rac
(
&
s
->
c
,
s
->
header_state
);
// s->rate_scalability= get_rac(&s->c, s->header_state);
tmp
=
get_symbol
(
&
s
->
c
,
s
->
header_state
,
0
)
+
1
;
if
(
tmp
<
1
||
tmp
>
MAX_REF_FRAMES
){
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"reference frame count is %d
\n
"
,
tmp
);
return
-
1
;
}
s
->
max_ref_frames
=
tmp
;
GET_S
(
s
->
max_ref_frames
,
tmp
<
(
unsigned
)
MAX_REF_FRAMES
)
s
->
max_ref_frames
++
;
decode_qlogs
(
s
);
}
...
...
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