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
01fc5d66
Commit
01fc5d66
authored
Sep 08, 2012
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo: check ff_find_unused_picture() return value for errors
parent
32c7589b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
mpegvideo.c
libavcodec/mpegvideo.c
+12
-0
No files found.
libavcodec/mpegvideo.c
View file @
01fc5d66
...
...
@@ -1341,6 +1341,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
pic
=
s
->
current_picture_ptr
;
}
else
{
i
=
ff_find_unused_picture
(
s
,
0
);
if
(
i
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"no frame buffer available
\n
"
);
return
i
;
}
pic
=
&
s
->
picture
[
i
];
}
...
...
@@ -1404,6 +1408,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
/* Allocate a dummy frame */
i
=
ff_find_unused_picture
(
s
,
0
);
if
(
i
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"no frame buffer available
\n
"
);
return
i
;
}
s
->
last_picture_ptr
=
&
s
->
picture
[
i
];
if
(
ff_alloc_picture
(
s
,
s
->
last_picture_ptr
,
0
)
<
0
)
{
s
->
last_picture_ptr
=
NULL
;
...
...
@@ -1418,6 +1426,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
{
/* Allocate a dummy frame */
i
=
ff_find_unused_picture
(
s
,
0
);
if
(
i
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"no frame buffer available
\n
"
);
return
i
;
}
s
->
next_picture_ptr
=
&
s
->
picture
[
i
];
if
(
ff_alloc_picture
(
s
,
s
->
next_picture_ptr
,
0
)
<
0
)
{
s
->
next_picture_ptr
=
NULL
;
...
...
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