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
a931d877
Commit
a931d877
authored
Apr 07, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg12dec: Prevent f_code from becoming invalid.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6c3d6a21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
mpeg12.c
libavcodec/mpeg12.c
+7
-0
No files found.
libavcodec/mpeg12.c
View file @
a931d877
...
...
@@ -1368,6 +1368,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
f_code
=
get_bits
(
&
s
->
gb
,
3
);
if
(
f_code
==
0
&&
(
avctx
->
err_recognition
&
(
AV_EF_BITSTREAM
|
AV_EF_COMPLIANT
)))
return
-
1
;
f_code
+=
!
f_code
;
s
->
mpeg_f_code
[
0
][
0
]
=
f_code
;
s
->
mpeg_f_code
[
0
][
1
]
=
f_code
;
}
...
...
@@ -1376,6 +1377,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
f_code
=
get_bits
(
&
s
->
gb
,
3
);
if
(
f_code
==
0
&&
(
avctx
->
err_recognition
&
(
AV_EF_BITSTREAM
|
AV_EF_COMPLIANT
)))
return
-
1
;
f_code
+=
!
f_code
;
s
->
mpeg_f_code
[
1
][
0
]
=
f_code
;
s
->
mpeg_f_code
[
1
][
1
]
=
f_code
;
}
...
...
@@ -1536,6 +1538,11 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
s
->
current_picture
.
f
.
pict_type
=
s
->
pict_type
;
s
->
current_picture
.
f
.
key_frame
=
s
->
pict_type
==
AV_PICTURE_TYPE_I
;
}
s
->
mpeg_f_code
[
0
][
0
]
+=
!
s
->
mpeg_f_code
[
0
][
0
];
s
->
mpeg_f_code
[
0
][
1
]
+=
!
s
->
mpeg_f_code
[
0
][
1
];
s
->
mpeg_f_code
[
1
][
0
]
+=
!
s
->
mpeg_f_code
[
1
][
0
];
s
->
mpeg_f_code
[
1
][
1
]
+=
!
s
->
mpeg_f_code
[
1
][
1
];
s
->
intra_dc_precision
=
get_bits
(
&
s
->
gb
,
2
);
s
->
picture_structure
=
get_bits
(
&
s
->
gb
,
2
);
s
->
top_field_first
=
get_bits1
(
&
s
->
gb
);
...
...
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