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
5d171b1f
Commit
5d171b1f
authored
Jul 03, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvdec: check if there is enough data
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
f8a81755
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
jvdec.c
libavcodec/jvdec.c
+6
-5
No files found.
libavcodec/jvdec.c
View file @
5d171b1f
...
...
@@ -137,6 +137,9 @@ static int decode_frame(AVCodecContext *avctx,
const
uint8_t
*
buf_end
=
buf
+
avpkt
->
size
;
int
video_size
,
video_type
,
i
,
j
;
if
(
avpkt
->
size
<
6
)
return
AVERROR_INVALIDDATA
;
video_size
=
AV_RL32
(
buf
);
video_type
=
buf
[
4
];
buf
+=
5
;
...
...
@@ -162,11 +165,9 @@ static int decode_frame(AVCodecContext *avctx,
buf
+=
video_size
;
}
else
if
(
video_type
==
2
)
{
if
(
buf
+
1
<=
buf_end
)
{
int
v
=
*
buf
++
;
for
(
j
=
0
;
j
<
avctx
->
height
;
j
++
)
memset
(
s
->
frame
.
data
[
0
]
+
j
*
s
->
frame
.
linesize
[
0
],
v
,
avctx
->
width
);
}
int
v
=
*
buf
++
;
for
(
j
=
0
;
j
<
avctx
->
height
;
j
++
)
memset
(
s
->
frame
.
data
[
0
]
+
j
*
s
->
frame
.
linesize
[
0
],
v
,
avctx
->
width
);
}
else
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"unsupported frame type %i
\n
"
,
video_type
);
return
AVERROR_INVALIDDATA
;
...
...
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