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
979bea13
Commit
979bea13
authored
Sep 17, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check all svq3_get_ue_golomb() returns.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a64b028a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
dirac.c
libavcodec/dirac.c
+8
-8
rv30.c
libavcodec/rv30.c
+2
-2
rv40.c
libavcodec/rv40.c
+4
-1
svq3.c
libavcodec/svq3.c
+6
-6
No files found.
libavcodec/dirac.c
View file @
979bea13
...
@@ -120,7 +120,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
...
@@ -120,7 +120,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
// chroma subsampling
// chroma subsampling
if
(
get_bits1
(
gb
))
if
(
get_bits1
(
gb
))
source
->
chroma_format
=
svq3_get_ue_golomb
(
gb
);
source
->
chroma_format
=
svq3_get_ue_golomb
(
gb
);
if
(
source
->
chroma_format
>
2
)
{
if
(
source
->
chroma_format
>
2
U
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown chroma format %d
\n
"
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown chroma format %d
\n
"
,
source
->
chroma_format
);
source
->
chroma_format
);
return
-
1
;
return
-
1
;
...
@@ -128,14 +128,14 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
...
@@ -128,14 +128,14 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
if
(
get_bits1
(
gb
))
if
(
get_bits1
(
gb
))
source
->
interlaced
=
svq3_get_ue_golomb
(
gb
);
source
->
interlaced
=
svq3_get_ue_golomb
(
gb
);
if
(
source
->
interlaced
>
1
)
if
(
source
->
interlaced
>
1
U
)
return
-
1
;
return
-
1
;
// frame rate
// frame rate
if
(
get_bits1
(
gb
))
{
if
(
get_bits1
(
gb
))
{
source
->
frame_rate_index
=
svq3_get_ue_golomb
(
gb
);
source
->
frame_rate_index
=
svq3_get_ue_golomb
(
gb
);
if
(
source
->
frame_rate_index
>
10
)
if
(
source
->
frame_rate_index
>
10
U
)
return
-
1
;
return
-
1
;
if
(
!
source
->
frame_rate_index
)
{
if
(
!
source
->
frame_rate_index
)
{
...
@@ -156,7 +156,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
...
@@ -156,7 +156,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
if
(
get_bits1
(
gb
))
{
if
(
get_bits1
(
gb
))
{
source
->
aspect_ratio_index
=
svq3_get_ue_golomb
(
gb
);
source
->
aspect_ratio_index
=
svq3_get_ue_golomb
(
gb
);
if
(
source
->
aspect_ratio_index
>
6
)
if
(
source
->
aspect_ratio_index
>
6
U
)
return
-
1
;
return
-
1
;
if
(
!
source
->
aspect_ratio_index
)
{
if
(
!
source
->
aspect_ratio_index
)
{
...
@@ -179,7 +179,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
...
@@ -179,7 +179,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
if
(
get_bits1
(
gb
))
{
if
(
get_bits1
(
gb
))
{
source
->
pixel_range_index
=
svq3_get_ue_golomb
(
gb
);
source
->
pixel_range_index
=
svq3_get_ue_golomb
(
gb
);
if
(
source
->
pixel_range_index
>
4
)
if
(
source
->
pixel_range_index
>
4
U
)
return
-
1
;
return
-
1
;
// This assumes either fullrange or MPEG levels only
// This assumes either fullrange or MPEG levels only
...
@@ -207,7 +207,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
...
@@ -207,7 +207,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
if
(
get_bits1
(
gb
))
{
if
(
get_bits1
(
gb
))
{
idx
=
source
->
color_spec_index
=
svq3_get_ue_golomb
(
gb
);
idx
=
source
->
color_spec_index
=
svq3_get_ue_golomb
(
gb
);
if
(
source
->
color_spec_index
>
4
)
if
(
source
->
color_spec_index
>
4
U
)
return
-
1
;
return
-
1
;
avctx
->
color_primaries
=
dirac_color_presets
[
idx
].
color_primaries
;
avctx
->
color_primaries
=
dirac_color_presets
[
idx
].
color_primaries
;
...
@@ -217,7 +217,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
...
@@ -217,7 +217,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
if
(
!
source
->
color_spec_index
)
{
if
(
!
source
->
color_spec_index
)
{
if
(
get_bits1
(
gb
))
{
if
(
get_bits1
(
gb
))
{
idx
=
svq3_get_ue_golomb
(
gb
);
idx
=
svq3_get_ue_golomb
(
gb
);
if
(
idx
<
3
)
if
(
idx
<
3
U
)
avctx
->
color_primaries
=
dirac_primaries
[
idx
];
avctx
->
color_primaries
=
dirac_primaries
[
idx
];
}
}
...
@@ -259,7 +259,7 @@ int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
...
@@ -259,7 +259,7 @@ int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
else
if
(
version_major
>
2
)
else
if
(
version_major
>
2
)
av_log
(
avctx
,
AV_LOG_WARNING
,
"Stream may have unhandled features
\n
"
);
av_log
(
avctx
,
AV_LOG_WARNING
,
"Stream may have unhandled features
\n
"
);
if
(
video_format
>
20
)
if
(
video_format
>
20
U
)
return
-
1
;
return
-
1
;
// Fill in defaults for the source parameters.
// Fill in defaults for the source parameters.
...
...
libavcodec/rv30.c
View file @
979bea13
...
@@ -79,7 +79,7 @@ static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t
...
@@ -79,7 +79,7 @@ static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t
for
(
i
=
0
;
i
<
4
;
i
++
,
dst
+=
r
->
intra_types_stride
-
4
){
for
(
i
=
0
;
i
<
4
;
i
++
,
dst
+=
r
->
intra_types_stride
-
4
){
for
(
j
=
0
;
j
<
4
;
j
+=
2
){
for
(
j
=
0
;
j
<
4
;
j
+=
2
){
int
code
=
svq3_get_ue_golomb
(
gb
)
<<
1
;
int
code
=
svq3_get_ue_golomb
(
gb
)
<<
1
;
if
(
code
>=
81
*
2
){
if
(
code
>=
81
U
*
2U
){
av_log
(
r
->
s
.
avctx
,
AV_LOG_ERROR
,
"Incorrect intra prediction code
\n
"
);
av_log
(
r
->
s
.
avctx
,
AV_LOG_ERROR
,
"Incorrect intra prediction code
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -108,7 +108,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
...
@@ -108,7 +108,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
GetBitContext
*
gb
=
&
s
->
gb
;
GetBitContext
*
gb
=
&
s
->
gb
;
int
code
=
svq3_get_ue_golomb
(
gb
);
int
code
=
svq3_get_ue_golomb
(
gb
);
if
(
code
>
11
){
if
(
code
>
11
U
){
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Incorrect MB type code
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Incorrect MB type code
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
...
libavcodec/rv40.c
View file @
979bea13
...
@@ -231,8 +231,11 @@ static int rv40_decode_mb_info(RV34DecContext *r)
...
@@ -231,8 +231,11 @@ static int rv40_decode_mb_info(RV34DecContext *r)
int
blocks
[
RV34_MB_TYPES
]
=
{
0
};
int
blocks
[
RV34_MB_TYPES
]
=
{
0
};
int
count
=
0
;
int
count
=
0
;
if
(
!
r
->
s
.
mb_skip_run
)
if
(
!
r
->
s
.
mb_skip_run
)
{
r
->
s
.
mb_skip_run
=
svq3_get_ue_golomb
(
gb
)
+
1
;
r
->
s
.
mb_skip_run
=
svq3_get_ue_golomb
(
gb
)
+
1
;
if
(
r
->
s
.
mb_skip_run
>
(
unsigned
)
s
->
mb_num
)
return
-
1
;
}
if
(
--
r
->
s
.
mb_skip_run
)
if
(
--
r
->
s
.
mb_skip_run
)
return
RV34_MB_SKIP
;
return
RV34_MB_SKIP
;
...
...
libavcodec/svq3.c
View file @
979bea13
...
@@ -221,7 +221,7 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
...
@@ -221,7 +221,7 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
for
(
limit
=
(
16
>>
intra
);
index
<
16
;
index
=
limit
,
limit
+=
8
)
{
for
(
limit
=
(
16
>>
intra
);
index
<
16
;
index
=
limit
,
limit
+=
8
)
{
for
(;
(
vlc
=
svq3_get_ue_golomb
(
gb
))
!=
0
;
index
++
)
{
for
(;
(
vlc
=
svq3_get_ue_golomb
(
gb
))
!=
0
;
index
++
)
{
if
(
vlc
==
INVALID_VLC
)
if
(
vlc
<
0
)
return
-
1
;
return
-
1
;
sign
=
(
vlc
&
0x1
)
-
1
;
sign
=
(
vlc
&
0x1
)
-
1
;
...
@@ -239,7 +239,7 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
...
@@ -239,7 +239,7 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
level
=
((
vlc
+
9
)
>>
2
)
-
run
;
level
=
((
vlc
+
9
)
>>
2
)
-
run
;
}
}
}
else
{
}
else
{
if
(
vlc
<
16
)
{
if
(
vlc
<
16
U
)
{
run
=
svq3_dct_tables
[
intra
][
vlc
].
run
;
run
=
svq3_dct_tables
[
intra
][
vlc
].
run
;
level
=
svq3_dct_tables
[
intra
][
vlc
].
level
;
level
=
svq3_dct_tables
[
intra
][
vlc
].
level
;
}
else
if
(
intra
)
{
}
else
if
(
intra
)
{
...
@@ -571,7 +571,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
...
@@ -571,7 +571,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
for
(
i
=
0
;
i
<
16
;
i
+=
2
)
{
for
(
i
=
0
;
i
<
16
;
i
+=
2
)
{
vlc
=
svq3_get_ue_golomb
(
&
s
->
gb
);
vlc
=
svq3_get_ue_golomb
(
&
s
->
gb
);
if
(
vlc
>=
25
){
if
(
vlc
>=
25
U
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"luma prediction:%d
\n
"
,
vlc
);
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"luma prediction:%d
\n
"
,
vlc
);
return
-
1
;
return
-
1
;
}
}
...
@@ -643,7 +643,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
...
@@ -643,7 +643,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
}
}
if
(
!
IS_INTRA16x16
(
mb_type
)
&&
(
!
IS_SKIP
(
mb_type
)
||
s
->
pict_type
==
AV_PICTURE_TYPE_B
))
{
if
(
!
IS_INTRA16x16
(
mb_type
)
&&
(
!
IS_SKIP
(
mb_type
)
||
s
->
pict_type
==
AV_PICTURE_TYPE_B
))
{
if
((
vlc
=
svq3_get_ue_golomb
(
&
s
->
gb
))
>=
48
){
if
((
vlc
=
svq3_get_ue_golomb
(
&
s
->
gb
))
>=
48
U
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"cbp_vlc=%d
\n
"
,
vlc
);
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"cbp_vlc=%d
\n
"
,
vlc
);
return
-
1
;
return
-
1
;
}
}
...
@@ -653,7 +653,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
...
@@ -653,7 +653,7 @@ static int svq3_decode_mb(SVQ3Context *svq3, unsigned int mb_type)
if
(
IS_INTRA16x16
(
mb_type
)
||
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
&&
s
->
adaptive_quant
&&
cbp
))
{
if
(
IS_INTRA16x16
(
mb_type
)
||
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
&&
s
->
adaptive_quant
&&
cbp
))
{
s
->
qscale
+=
svq3_get_se_golomb
(
&
s
->
gb
);
s
->
qscale
+=
svq3_get_se_golomb
(
&
s
->
gb
);
if
(
s
->
qscale
>
31
){
if
(
s
->
qscale
>
31
U
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"qscale:%d
\n
"
,
s
->
qscale
);
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"qscale:%d
\n
"
,
s
->
qscale
);
return
-
1
;
return
-
1
;
}
}
...
@@ -757,7 +757,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
...
@@ -757,7 +757,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
skip_bits_long
(
&
s
->
gb
,
0
);
skip_bits_long
(
&
s
->
gb
,
0
);
}
}
if
((
i
=
svq3_get_ue_golomb
(
&
s
->
gb
))
==
INVALID_VLC
||
i
>=
3
){
if
((
i
=
svq3_get_ue_golomb
(
&
s
->
gb
))
>=
3U
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"illegal slice type %d
\n
"
,
i
);
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"illegal slice type %d
\n
"
,
i
);
return
-
1
;
return
-
1
;
}
}
...
...
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