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
8b92b792
Commit
8b92b792
authored
Apr 07, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some checks to avoid segfault
Originally committed as revision 1740 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
9f2e61b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
h264.c
libavcodec/h264.c
+18
-14
No files found.
libavcodec/h264.c
View file @
8b92b792
...
@@ -2826,7 +2826,16 @@ static int decode_slice_header(H264Context *h){
...
@@ -2826,7 +2826,16 @@ static int decode_slice_header(H264Context *h){
return
-
1
;
return
-
1
;
}
}
h
->
pps
=
h
->
pps_buffer
[
pps_id
];
h
->
pps
=
h
->
pps_buffer
[
pps_id
];
if
(
h
->
pps
.
slice_group_count
==
0
){
fprintf
(
stderr
,
"non existing PPS referenced
\n
"
);
return
-
1
;
}
h
->
sps
=
h
->
sps_buffer
[
h
->
pps
.
sps_id
];
h
->
sps
=
h
->
sps_buffer
[
h
->
pps
.
sps_id
];
if
(
h
->
sps
.
log2_max_frame_num
==
0
){
fprintf
(
stderr
,
"non existing SPS referenced
\n
"
);
return
-
1
;
}
s
->
mb_width
=
h
->
sps
.
mb_width
;
s
->
mb_width
=
h
->
sps
.
mb_width
;
s
->
mb_height
=
h
->
sps
.
mb_height
;
s
->
mb_height
=
h
->
sps
.
mb_height
;
...
@@ -4035,8 +4044,8 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
...
@@ -4035,8 +4044,8 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
case
NAL_DPC
:
case
NAL_DPC
:
init_get_bits
(
&
h
->
inter_gb
,
ptr
,
bit_length
);
init_get_bits
(
&
h
->
inter_gb
,
ptr
,
bit_length
);
h
->
inter_gb_ptr
=
&
h
->
inter_gb
;
h
->
inter_gb_ptr
=
&
h
->
inter_gb
;
if
(
h
->
redundant_pic_count
==
0
)
if
(
h
->
redundant_pic_count
==
0
&&
h
->
intra_gb_ptr
&&
s
->
data_partitioning
)
decode_slice
(
h
);
decode_slice
(
h
);
break
;
break
;
case
NAL_SEI
:
case
NAL_SEI
:
...
@@ -4067,6 +4076,8 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
...
@@ -4067,6 +4076,8 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
s
->
current_picture
.
key_frame
=
s
->
pict_type
==
I_TYPE
;
s
->
current_picture
.
key_frame
=
s
->
pict_type
==
I_TYPE
;
}
}
if
(
!
s
->
current_picture_ptr
)
return
buf_index
;
//no frame
h
->
prev_frame_num_offset
=
h
->
frame_num_offset
;
h
->
prev_frame_num_offset
=
h
->
frame_num_offset
;
h
->
prev_frame_num
=
h
->
frame_num
;
h
->
prev_frame_num
=
h
->
frame_num
;
if
(
s
->
current_picture_ptr
->
reference
){
if
(
s
->
current_picture_ptr
->
reference
){
...
@@ -4147,21 +4158,14 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -4147,21 +4158,14 @@ static int decode_frame(AVCodecContext *avctx,
*pict= *(AVFrame*)&s->last_picture;
*pict= *(AVFrame*)&s->last_picture;
}
}
#endif
#endif
if
(
!
s
->
current_picture_ptr
){
fprintf
(
stderr
,
"error, NO frame
\n
"
);
return
-
1
;
}
*
pict
=
*
(
AVFrame
*
)
&
s
->
current_picture
;
//FIXME
*
pict
=
*
(
AVFrame
*
)
&
s
->
current_picture
;
//FIXME
assert
(
pict
->
data
[
0
]);
assert
(
pict
->
data
[
0
]);
//printf("out %d\n", (int)pict->data[0]);
//printf("out %d\n", (int)pict->data[0]);
if
(
avctx
->
debug
&
FF_DEBUG_QP
){
int8_t
*
qtab
=
pict
->
qscale_table
;
int
x
,
y
;
for
(
y
=
0
;
y
<
s
->
mb_height
;
y
++
){
for
(
x
=
0
;
x
<
s
->
mb_width
;
x
++
){
printf
(
"%2d "
,
qtab
[
x
+
y
*
s
->
mb_width
]);
}
printf
(
"
\n
"
);
}
printf
(
"
\n
"
);
}
#if 0 //?
#if 0 //?
/* Return the Picture timestamp as the frame number */
/* Return the Picture timestamp as the frame number */
...
...
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