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
59271622
Commit
59271622
authored
Sep 20, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/srtdec: add some memory checks
parent
6a65da3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
srtdec.c
libavcodec/srtdec.c
+4
-2
No files found.
libavcodec/srtdec.c
View file @
59271622
...
@@ -223,7 +223,7 @@ static int srt_decode_frame(AVCodecContext *avctx,
...
@@ -223,7 +223,7 @@ static int srt_decode_frame(AVCodecContext *avctx,
char
buffer
[
2048
];
char
buffer
[
2048
];
const
char
*
ptr
=
avpkt
->
data
;
const
char
*
ptr
=
avpkt
->
data
;
const
char
*
end
=
avpkt
->
data
+
avpkt
->
size
;
const
char
*
end
=
avpkt
->
data
+
avpkt
->
size
;
int
size
;
int
size
,
ret
;
const
uint8_t
*
p
=
av_packet_get_side_data
(
avpkt
,
AV_PKT_DATA_SUBTITLE_POSITION
,
&
size
);
const
uint8_t
*
p
=
av_packet_get_side_data
(
avpkt
,
AV_PKT_DATA_SUBTITLE_POSITION
,
&
size
);
if
(
p
&&
size
==
16
)
{
if
(
p
&&
size
==
16
)
{
...
@@ -252,7 +252,9 @@ static int srt_decode_frame(AVCodecContext *avctx,
...
@@ -252,7 +252,9 @@ static int srt_decode_frame(AVCodecContext *avctx,
}
}
ptr
=
srt_to_ass
(
avctx
,
buffer
,
buffer
+
sizeof
(
buffer
),
ptr
,
ptr
=
srt_to_ass
(
avctx
,
buffer
,
buffer
+
sizeof
(
buffer
),
ptr
,
x1
,
y1
,
x2
,
y2
);
x1
,
y1
,
x2
,
y2
);
ff_ass_add_rect
(
sub
,
buffer
,
ts_start
,
ts_end
-
ts_start
,
0
);
ret
=
ff_ass_add_rect
(
sub
,
buffer
,
ts_start
,
ts_end
-
ts_start
,
0
);
if
(
ret
<
0
)
return
ret
;
}
}
*
got_sub_ptr
=
sub
->
num_rects
>
0
;
*
got_sub_ptr
=
sub
->
num_rects
>
0
;
...
...
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