Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d1d76780
Commit
d1d76780
authored
May 20, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: fix the check for mixed IDR/non-IDR slices
parent
b13fc1e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
h264_slice.c
libavcodec/h264_slice.c
+7
-0
h264dec.c
libavcodec/h264dec.c
+0
-6
h264dec.h
libavcodec/h264dec.h
+5
-0
No files found.
libavcodec/h264_slice.c
View file @
d1d76780
...
@@ -1333,6 +1333,8 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
...
@@ -1333,6 +1333,8 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
h
->
nb_mmco
=
sl
->
nb_mmco
;
h
->
nb_mmco
=
sl
->
nb_mmco
;
h
->
explicit_ref_marking
=
sl
->
explicit_ref_marking
;
h
->
explicit_ref_marking
=
sl
->
explicit_ref_marking
;
h
->
picture_idr
=
nal
->
type
==
H264_NAL_IDR_SLICE
;
/* Set the frame properties/side data. Only done for the second field in
/* Set the frame properties/side data. Only done for the second field in
* field coded frames, since some SEI information is present for each field
* field coded frames, since some SEI information is present for each field
* and is merged by the SEI parsing code. */
* and is merged by the SEI parsing code. */
...
@@ -1599,6 +1601,11 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
...
@@ -1599,6 +1601,11 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
}
}
}
}
if
(
h
->
picture_idr
&&
nal
->
type
!=
H264_NAL_IDR_SLICE
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Invalid mix of IDR and non-IDR slices
\n
"
);
return
AVERROR_INVALIDDATA
;
}
assert
(
h
->
mb_num
==
h
->
mb_width
*
h
->
mb_height
);
assert
(
h
->
mb_num
==
h
->
mb_width
*
h
->
mb_height
);
if
(
sl
->
first_mb_addr
<<
FIELD_OR_MBAFF_PICTURE
(
h
)
>=
h
->
mb_num
||
if
(
sl
->
first_mb_addr
<<
FIELD_OR_MBAFF_PICTURE
(
h
)
>=
h
->
mb_num
||
sl
->
first_mb_addr
>=
h
->
mb_num
)
{
sl
->
first_mb_addr
>=
h
->
mb_num
)
{
...
...
libavcodec/h264dec.c
View file @
d1d76780
...
@@ -694,12 +694,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
...
@@ -694,12 +694,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
err
=
0
;
err
=
0
;
switch
(
nal
->
type
)
{
switch
(
nal
->
type
)
{
case
H264_NAL_IDR_SLICE
:
case
H264_NAL_IDR_SLICE
:
if
(
nal
->
type
!=
H264_NAL_IDR_SLICE
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Invalid mix of idr and non-idr slices
\n
"
);
ret
=
-
1
;
goto
end
;
}
idr
(
h
);
// FIXME ensure we don't lose some frames if there is reordering
idr
(
h
);
// FIXME ensure we don't lose some frames if there is reordering
case
H264_NAL_SLICE
:
case
H264_NAL_SLICE
:
sl
->
gb
=
nal
->
gb
;
sl
->
gb
=
nal
->
gb
;
...
...
libavcodec/h264dec.h
View file @
d1d76780
...
@@ -366,6 +366,11 @@ typedef struct H264Context {
...
@@ -366,6 +366,11 @@ typedef struct H264Context {
*/
*/
int
postpone_filter
;
int
postpone_filter
;
/*
* Set to 1 when the current picture is IDR, 0 otherwise.
*/
int
picture_idr
;
int8_t
(
*
intra4x4_pred_mode
);
int8_t
(
*
intra4x4_pred_mode
);
H264PredContext
hpc
;
H264PredContext
hpc
;
...
...
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