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
4c850730
Commit
4c850730
authored
Sep 20, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/jacosubdec: add some memory checks
parent
d210c0e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
jacosubdec.c
libavcodec/jacosubdec.c
+5
-4
No files found.
libavcodec/jacosubdec.c
View file @
4c850730
...
...
@@ -168,6 +168,7 @@ static void jacosub_to_ass(AVCodecContext *avctx, AVBPrint *dst, const char *src
static
int
jacosub_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_sub_ptr
,
AVPacket
*
avpkt
)
{
int
ret
;
AVSubtitle
*
sub
=
data
;
const
char
*
ptr
=
avpkt
->
data
;
...
...
@@ -176,7 +177,6 @@ static int jacosub_decode_frame(AVCodecContext *avctx,
if
(
*
ptr
)
{
AVBPrint
buffer
;
char
*
dec_sub
;
// skip timers
ptr
=
jss_skip_whitespace
(
ptr
);
...
...
@@ -185,9 +185,10 @@ static int jacosub_decode_frame(AVCodecContext *avctx,
av_bprint_init
(
&
buffer
,
JSS_MAX_LINESIZE
,
JSS_MAX_LINESIZE
);
jacosub_to_ass
(
avctx
,
&
buffer
,
ptr
);
av_bprint_finalize
(
&
buffer
,
&
dec_sub
);
ff_ass_add_rect
(
sub
,
dec_sub
,
avpkt
->
pts
,
avpkt
->
duration
,
0
);
av_free
(
dec_sub
);
ret
=
ff_ass_add_rect_bprint
(
sub
,
&
buffer
,
avpkt
->
pts
,
avpkt
->
duration
,
0
);
av_bprint_finalize
(
&
buffer
,
NULL
);
if
(
ret
<
0
)
return
ret
;
}
end:
...
...
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