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
15739a9b
Commit
15739a9b
authored
Dec 13, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvdec: Do not feed the decoder with known wrong data
Still assume the size value is right in non-explode mode.
parent
e518cb86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
jvdec.c
libavformat/jvdec.c
+15
-2
No files found.
libavformat/jvdec.c
View file @
15739a9b
...
...
@@ -128,10 +128,23 @@ static int read_header(AVFormatContext *s)
jvf
->
audio_size
=
avio_rl32
(
pb
);
jvf
->
video_size
=
avio_rl32
(
pb
);
jvf
->
palette_size
=
avio_r8
(
pb
)
?
768
:
0
;
jvf
->
video_size
=
FFMIN
(
FFMAX
(
jvf
->
video_size
,
0
),
INT_MAX
-
JV_PREAMBLE_SIZE
-
jvf
->
palette_size
);
if
((
jvf
->
video_size
|
jvf
->
audio_size
)
&
~
0xFFFFFF
||
e
->
size
-
jvf
->
audio_size
-
jvf
->
video_size
-
jvf
->
palette_size
<
0
)
{
if
(
s
->
error_recognition
&
AV_EF_EXPLODE
)
{
read_close
(
s
);
return
AVERROR_INVALIDDATA
;
}
jvf
->
audio_size
=
jvf
->
video_size
=
jvf
->
palette_size
=
0
;
}
if
(
avio_r8
(
pb
))
av_log
(
s
,
AV_LOG_WARNING
,
"unsupported audio codec
\n
"
);
jvf
->
video_type
=
avio_r8
(
pb
);
avio_skip
(
pb
,
1
);
...
...
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