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
1f860793
Commit
1f860793
authored
Aug 12, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpeg12dec: Check chroma_format
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
0d2a62d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
mpeg12dec.c
libavcodec/mpeg12dec.c
+7
-0
No files found.
libavcodec/mpeg12dec.c
View file @
1f860793
...
...
@@ -1384,6 +1384,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
case
1
:
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_LEFT
;
break
;
case
2
:
case
3
:
avctx
->
chroma_sample_location
=
AVCHROMA_LOC_TOPLEFT
;
break
;
default:
av_assert0
(
0
);
}
}
// MPEG-2
...
...
@@ -1466,6 +1467,12 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
s
->
avctx
->
level
=
get_bits
(
&
s
->
gb
,
4
);
s
->
progressive_sequence
=
get_bits1
(
&
s
->
gb
);
/* progressive_sequence */
s
->
chroma_format
=
get_bits
(
&
s
->
gb
,
2
);
/* chroma_format 1=420, 2=422, 3=444 */
if
(
!
s
->
chroma_format
)
{
s
->
chroma_format
=
1
;
av_log
(
s
->
avctx
,
AV_LOG_WARNING
,
"Chroma format invalid
\n
"
);
}
horiz_size_ext
=
get_bits
(
&
s
->
gb
,
2
);
vert_size_ext
=
get_bits
(
&
s
->
gb
,
2
);
s
->
width
|=
(
horiz_size_ext
<<
12
);
...
...
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