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
e3e55758
Commit
e3e55758
authored
Sep 12, 2015
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/img2dec: Improve jpeg auto-detection.
Fixes ticket #4841.
parent
a84613b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
img2dec.c
libavformat/img2dec.c
+20
-6
No files found.
libavformat/img2dec.c
View file @
e3e55758
...
...
@@ -660,18 +660,14 @@ static int j2k_probe(AVProbeData *p)
static
int
jpeg_probe
(
AVProbeData
*
p
)
{
const
uint8_t
*
b
=
p
->
buf
;
int
i
,
state
=
0xD8
,
exif_size
=
0
;
int
i
,
state
=
0xD8
;
if
(
AV_RB16
(
b
)
!=
0xFFD8
||
AV_RB32
(
b
)
==
0xFFD8FFF7
)
return
0
;
b
+=
2
;
if
(
AV_RB16
(
b
)
==
0xFFE1
&&
AV_RB32
(
b
+
4
)
==
AV_RB32
(
"Exif"
))
{
exif_size
=
AV_RB16
(
b
+
2
)
+
2
;
b
+=
exif_size
;
}
for
(
i
=
0
;
i
+
exif_size
<
p
->
buf_size
-
2
;
i
++
)
{
for
(
i
=
0
;
i
<
p
->
buf_size
-
3
;
i
++
)
{
int
c
;
if
(
b
[
i
]
!=
0xFF
)
continue
;
...
...
@@ -700,6 +696,24 @@ static int jpeg_probe(AVProbeData *p)
return
0
;
state
=
0xD9
;
break
;
case
0xE0
:
case
0xE1
:
case
0xE2
:
case
0xE3
:
case
0xE4
:
case
0xE5
:
case
0xE6
:
case
0xE7
:
case
0xE8
:
case
0xE9
:
case
0xEA
:
case
0xEB
:
case
0xEC
:
case
0xED
:
case
0xEE
:
case
0xEF
:
i
+=
AV_RB16
(
&
b
[
i
+
2
])
+
1
;
break
;
default:
if
(
(
c
>=
0x02
&&
c
<=
0xBF
)
||
c
==
0xC8
)
...
...
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