Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
03bc7a00
Commit
03bc7a00
authored
Mar 02, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mjpegdec: fix endiansoup
Fixes Ticket2175 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6091a8d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
mjpegdec.c
libavcodec/mjpegdec.c
+5
-7
No files found.
libavcodec/mjpegdec.c
View file @
03bc7a00
...
@@ -1356,7 +1356,6 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
...
@@ -1356,7 +1356,6 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
id
=
get_bits_long
(
&
s
->
gb
,
32
);
id
=
get_bits_long
(
&
s
->
gb
,
32
);
id
=
av_be2ne32
(
id
);
len
-=
6
;
len
-=
6
;
if
(
s
->
avctx
->
debug
&
FF_DEBUG_STARTCODE
)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_STARTCODE
)
...
@@ -1365,7 +1364,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
...
@@ -1365,7 +1364,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
/* Buggy AVID, it puts EOI only at every 10th frame. */
/* Buggy AVID, it puts EOI only at every 10th frame. */
/* Also, this fourcc is used by non-avid files too, it holds some
/* Also, this fourcc is used by non-avid files too, it holds some
information, but it's always present in AVID-created files. */
information, but it's always present in AVID-created files. */
if
(
id
==
AV_R
L
32
(
"AVI1"
))
{
if
(
id
==
AV_R
B
32
(
"AVI1"
))
{
/* structure:
/* structure:
4bytes AVI1
4bytes AVI1
1bytes polarity
1bytes polarity
...
@@ -1387,7 +1386,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
...
@@ -1387,7 +1386,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
// len -= 2;
// len -= 2;
if
(
id
==
AV_R
L
32
(
"JFIF"
))
{
if
(
id
==
AV_R
B
32
(
"JFIF"
))
{
int
t_w
,
t_h
,
v1
,
v2
;
int
t_w
,
t_h
,
v1
,
v2
;
skip_bits
(
&
s
->
gb
,
8
);
/* the trailing zero-byte */
skip_bits
(
&
s
->
gb
,
8
);
/* the trailing zero-byte */
v1
=
get_bits
(
&
s
->
gb
,
8
);
v1
=
get_bits
(
&
s
->
gb
,
8
);
...
@@ -1415,7 +1414,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
...
@@ -1415,7 +1414,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
goto
out
;
goto
out
;
}
}
if
(
id
==
AV_R
L
32
(
"Adob"
)
&&
(
get_bits
(
&
s
->
gb
,
8
)
==
'e'
))
{
if
(
id
==
AV_R
B
32
(
"Adob"
)
&&
(
get_bits
(
&
s
->
gb
,
8
)
==
'e'
))
{
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
"mjpeg: Adobe header found
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
"mjpeg: Adobe header found
\n
"
);
skip_bits
(
&
s
->
gb
,
16
);
/* version */
skip_bits
(
&
s
->
gb
,
16
);
/* version */
...
@@ -1426,7 +1425,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
...
@@ -1426,7 +1425,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
goto
out
;
goto
out
;
}
}
if
(
id
==
AV_R
L
32
(
"LJIF"
))
{
if
(
id
==
AV_R
B
32
(
"LJIF"
))
{
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
"Pegasus lossless jpeg header found
\n
"
);
"Pegasus lossless jpeg header found
\n
"
);
...
@@ -1453,10 +1452,9 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
...
@@ -1453,10 +1452,9 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
/* Apple MJPEG-A */
/* Apple MJPEG-A */
if
((
s
->
start_code
==
APP1
)
&&
(
len
>
(
0x28
-
8
)))
{
if
((
s
->
start_code
==
APP1
)
&&
(
len
>
(
0x28
-
8
)))
{
id
=
get_bits_long
(
&
s
->
gb
,
32
);
id
=
get_bits_long
(
&
s
->
gb
,
32
);
id
=
av_be2ne32
(
id
);
len
-=
4
;
len
-=
4
;
/* Apple MJPEG-A */
/* Apple MJPEG-A */
if
(
id
==
AV_R
L
32
(
"mjpg"
))
{
if
(
id
==
AV_R
B
32
(
"mjpg"
))
{
#if 0
#if 0
skip_bits(&s->gb, 32); /* field size */
skip_bits(&s->gb, 32); /* field size */
skip_bits(&s->gb, 32); /* pad field size */
skip_bits(&s->gb, 32); /* pad field size */
...
...
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