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
8e7808b5
Commit
8e7808b5
authored
Sep 20, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/realtextdec: add some memory checks
parent
27a9bee2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
realtextdec.c
libavcodec/realtextdec.c
+5
-2
No files found.
libavcodec/realtextdec.c
View file @
8e7808b5
...
@@ -59,6 +59,7 @@ static int rt_event_to_ass(AVBPrint *buf, const char *p)
...
@@ -59,6 +59,7 @@ static int rt_event_to_ass(AVBPrint *buf, const char *p)
static
int
realtext_decode_frame
(
AVCodecContext
*
avctx
,
static
int
realtext_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_sub_ptr
,
AVPacket
*
avpkt
)
void
*
data
,
int
*
got_sub_ptr
,
AVPacket
*
avpkt
)
{
{
int
ret
=
0
;
AVSubtitle
*
sub
=
data
;
AVSubtitle
*
sub
=
data
;
const
char
*
ptr
=
avpkt
->
data
;
const
char
*
ptr
=
avpkt
->
data
;
AVBPrint
buf
;
AVBPrint
buf
;
...
@@ -67,9 +68,11 @@ static int realtext_decode_frame(AVCodecContext *avctx,
...
@@ -67,9 +68,11 @@ static int realtext_decode_frame(AVCodecContext *avctx,
// note: no need to rescale pts & duration since they are in the same
// note: no need to rescale pts & duration since they are in the same
// timebase as ASS (1/100)
// timebase as ASS (1/100)
if
(
ptr
&&
avpkt
->
size
>
0
&&
!
rt_event_to_ass
(
&
buf
,
ptr
))
if
(
ptr
&&
avpkt
->
size
>
0
&&
!
rt_event_to_ass
(
&
buf
,
ptr
))
ff_ass_add_rect
(
sub
,
buf
.
str
,
avpkt
->
pts
,
avpkt
->
duration
,
0
);
ret
=
ff_ass_add_rect_bprint
(
sub
,
&
buf
,
avpkt
->
pts
,
avpkt
->
duration
,
0
);
*
got_sub_ptr
=
sub
->
num_rects
>
0
;
av_bprint_finalize
(
&
buf
,
NULL
);
av_bprint_finalize
(
&
buf
,
NULL
);
if
(
ret
<
0
)
return
ret
;
*
got_sub_ptr
=
sub
->
num_rects
>
0
;
return
avpkt
->
size
;
return
avpkt
->
size
;
}
}
...
...
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