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
eaba7c7f
Commit
eaba7c7f
authored
Jan 10, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picture heap corruption fix
Originally committed as revision 3819 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
4bbc6260
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
mpegvideo.c
libavcodec/mpegvideo.c
+23
-20
No files found.
libavcodec/mpegvideo.c
View file @
eaba7c7f
...
...
@@ -1959,6 +1959,29 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
const
int
encoding_delay
=
s
->
max_b_frames
;
int
direct
=
1
;
if
(
pic_arg
){
if
(
pic_arg
->
pts
!=
AV_NOPTS_VALUE
){
if
(
s
->
user_specified_pts
!=
AV_NOPTS_VALUE
){
int64_t
time
=
av_rescale
(
pic_arg
->
pts
,
s
->
avctx
->
frame_rate
,
s
->
avctx
->
frame_rate_base
*
(
int64_t
)
AV_TIME_BASE
);
int64_t
last
=
av_rescale
(
s
->
user_specified_pts
,
s
->
avctx
->
frame_rate
,
s
->
avctx
->
frame_rate_base
*
(
int64_t
)
AV_TIME_BASE
);
if
(
time
<=
last
){
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Error, Invalid timestamp=%Ld, last=%Ld
\n
"
,
pic_arg
->
pts
,
s
->
user_specified_pts
);
return
-
1
;
}
}
s
->
user_specified_pts
=
pic_arg
->
pts
;
}
else
{
if
(
s
->
user_specified_pts
!=
AV_NOPTS_VALUE
){
s
->
user_specified_pts
=
pic_arg
->
pts
=
s
->
user_specified_pts
+
AV_TIME_BASE
*
(
int64_t
)
s
->
avctx
->
frame_rate_base
/
s
->
avctx
->
frame_rate
;
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
"Warning: AVFrame.pts=? trying to guess (%Ld)
\n
"
,
pic_arg
->
pts
);
}
else
{
pic_arg
->
pts
=
av_rescale
(
pic_arg
->
display_picture_number
*
(
int64_t
)
s
->
avctx
->
frame_rate_base
,
AV_TIME_BASE
,
s
->
avctx
->
frame_rate
);
}
}
}
if
(
pic_arg
){
if
(
encoding_delay
&&
!
(
s
->
flags
&
CODEC_FLAG_INPUT_PRESERVED
))
direct
=
0
;
if
(
pic_arg
->
linesize
[
0
]
!=
s
->
linesize
)
direct
=
0
;
...
...
@@ -2021,26 +2044,6 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
pic
->
display_picture_number
=
s
->
input_picture_number
++
;
if
(
pic
->
pts
!=
AV_NOPTS_VALUE
){
if
(
s
->
user_specified_pts
!=
AV_NOPTS_VALUE
){
int64_t
time
=
av_rescale
(
pic
->
pts
,
s
->
avctx
->
frame_rate
,
s
->
avctx
->
frame_rate_base
*
(
int64_t
)
AV_TIME_BASE
);
int64_t
last
=
av_rescale
(
s
->
user_specified_pts
,
s
->
avctx
->
frame_rate
,
s
->
avctx
->
frame_rate_base
*
(
int64_t
)
AV_TIME_BASE
);
if
(
time
<=
last
){
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Error, Invalid timestamp=%Ld, last=%Ld
\n
"
,
pic
->
pts
,
s
->
user_specified_pts
);
return
-
1
;
}
}
s
->
user_specified_pts
=
pic
->
pts
;
}
else
{
if
(
s
->
user_specified_pts
!=
AV_NOPTS_VALUE
){
s
->
user_specified_pts
=
pic
->
pts
=
s
->
user_specified_pts
+
AV_TIME_BASE
*
(
int64_t
)
s
->
avctx
->
frame_rate_base
/
s
->
avctx
->
frame_rate
;
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
"Warning: AVFrame.pts=? trying to guess (%Ld)
\n
"
,
pic
->
pts
);
}
else
{
pic
->
pts
=
av_rescale
(
pic
->
display_picture_number
*
(
int64_t
)
s
->
avctx
->
frame_rate_base
,
AV_TIME_BASE
,
s
->
avctx
->
frame_rate
);
}
}
}
/* shift buffer entries */
...
...
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