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
e833b02f
Commit
e833b02f
authored
Sep 20, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/movtextdec: add some memory checks
parent
ac95b436
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
movtextdec.c
libavcodec/movtextdec.c
+5
-7
No files found.
libavcodec/movtextdec.c
View file @
e833b02f
...
@@ -60,7 +60,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
...
@@ -60,7 +60,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
void
*
data
,
int
*
got_sub_ptr
,
AVPacket
*
avpkt
)
void
*
data
,
int
*
got_sub_ptr
,
AVPacket
*
avpkt
)
{
{
AVSubtitle
*
sub
=
data
;
AVSubtitle
*
sub
=
data
;
int
ts_start
,
ts_end
;
int
ret
,
ts_start
,
ts_end
;
AVBPrint
buf
;
AVBPrint
buf
;
const
char
*
ptr
=
avpkt
->
data
;
const
char
*
ptr
=
avpkt
->
data
;
const
char
*
end
;
const
char
*
end
;
...
@@ -96,13 +96,11 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
...
@@ -96,13 +96,11 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
// Note that the spec recommends lines be no longer than 2048 characters.
// Note that the spec recommends lines be no longer than 2048 characters.
av_bprint_init
(
&
buf
,
0
,
AV_BPRINT_SIZE_UNLIMITED
);
av_bprint_init
(
&
buf
,
0
,
AV_BPRINT_SIZE_UNLIMITED
);
text_to_ass
(
&
buf
,
ptr
,
end
);
text_to_ass
(
&
buf
,
ptr
,
end
);
ret
=
ff_ass_add_rect_bprint
(
sub
,
&
buf
,
ts_start
,
ts_end
-
ts_start
,
0
);
if
(
!
av_bprint_is_complete
(
&
buf
))
return
AVERROR
(
ENOMEM
);
ff_ass_add_rect
(
sub
,
buf
.
str
,
ts_start
,
ts_end
-
ts_start
,
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