Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
0f0a8d98
Commit
0f0a8d98
authored
Oct 23, 2013
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ass: fix error handling in ff_ass_add_subrect
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
f148954b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
ass.c
libavcodec/ass.c
+12
-5
No files found.
libavcodec/ass.c
View file @
0f0a8d98
...
...
@@ -123,21 +123,28 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
AVSubtitleRect
**
rects
;
av_bprint_init
(
&
buf
,
0
,
AV_BPRINT_SIZE_UNLIMITED
);
if
((
dlen
=
ff_ass_bprint_dialog
(
&
buf
,
dialog
,
ts_start
,
duration
,
raw
))
<
0
)
return
dlen
;
if
((
ret
=
ff_ass_bprint_dialog
(
&
buf
,
dialog
,
ts_start
,
duration
,
raw
))
<
0
)
goto
err
;
dlen
=
ret
;
if
(
!
av_bprint_is_complete
(
&
buf
))
return
AVERROR
(
ENOMEM
)
;
goto
errnomem
;
rects
=
av_realloc
(
sub
->
rects
,
(
sub
->
num_rects
+
1
)
*
sizeof
(
*
sub
->
rects
));
if
(
!
rects
)
return
AVERROR
(
ENOMEM
)
;
goto
errnomem
;
sub
->
rects
=
rects
;
sub
->
end_display_time
=
FFMAX
(
sub
->
end_display_time
,
10
*
duration
);
rects
[
sub
->
num_rects
]
=
av_mallocz
(
sizeof
(
*
rects
[
0
]));
rects
[
sub
->
num_rects
]
->
type
=
SUBTITLE_ASS
;
ret
=
av_bprint_finalize
(
&
buf
,
&
rects
[
sub
->
num_rects
]
->
ass
);
if
(
ret
<
0
)
return
ret
;
goto
err
;
sub
->
num_rects
++
;
return
dlen
;
errnomem:
ret
=
AVERROR
(
ENOMEM
);
err:
av_bprint_finalize
(
&
buf
,
NULL
);
return
ret
;
}
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