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
1c16483c
Commit
1c16483c
authored
Nov 27, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mjpegdec: replace returns by goto fail in frame decode.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
de9fc0e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
mjpegdec.c
libavcodec/mjpegdec.c
+9
-7
No files found.
libavcodec/mjpegdec.c
View file @
1c16483c
...
@@ -1651,7 +1651,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -1651,7 +1651,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
case
DHT
:
case
DHT
:
if
((
ret
=
ff_mjpeg_decode_dht
(
s
))
<
0
)
{
if
((
ret
=
ff_mjpeg_decode_dht
(
s
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"huffman table decode error
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"huffman table decode error
\n
"
);
return
ret
;
goto
fail
;
}
}
break
;
break
;
case
SOF0
:
case
SOF0
:
...
@@ -1660,33 +1660,33 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -1660,33 +1660,33 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
s
->
ls
=
0
;
s
->
ls
=
0
;
s
->
progressive
=
0
;
s
->
progressive
=
0
;
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
return
ret
;
goto
fail
;
break
;
break
;
case
SOF2
:
case
SOF2
:
s
->
lossless
=
0
;
s
->
lossless
=
0
;
s
->
ls
=
0
;
s
->
ls
=
0
;
s
->
progressive
=
1
;
s
->
progressive
=
1
;
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
return
ret
;
goto
fail
;
break
;
break
;
case
SOF3
:
case
SOF3
:
s
->
lossless
=
1
;
s
->
lossless
=
1
;
s
->
ls
=
0
;
s
->
ls
=
0
;
s
->
progressive
=
0
;
s
->
progressive
=
0
;
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
return
ret
;
goto
fail
;
break
;
break
;
case
SOF48
:
case
SOF48
:
s
->
lossless
=
1
;
s
->
lossless
=
1
;
s
->
ls
=
1
;
s
->
ls
=
1
;
s
->
progressive
=
0
;
s
->
progressive
=
0
;
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
if
((
ret
=
ff_mjpeg_decode_sof
(
s
))
<
0
)
return
ret
;
goto
fail
;
break
;
break
;
case
LSE
:
case
LSE
:
if
(
!
CONFIG_JPEGLS_DECODER
||
if
(
!
CONFIG_JPEGLS_DECODER
||
(
ret
=
ff_jpegls_decode_lse
(
s
))
<
0
)
(
ret
=
ff_jpegls_decode_lse
(
s
))
<
0
)
return
ret
;
goto
fail
;
break
;
break
;
case
EOI
:
case
EOI
:
eoi_parser:
eoi_parser:
...
@@ -1723,7 +1723,7 @@ eoi_parser:
...
@@ -1723,7 +1723,7 @@ eoi_parser:
case
SOS
:
case
SOS
:
if
((
ret
=
ff_mjpeg_decode_sos
(
s
,
NULL
,
NULL
))
<
0
&&
if
((
ret
=
ff_mjpeg_decode_sos
(
s
,
NULL
,
NULL
))
<
0
&&
(
avctx
->
err_recognition
&
AV_EF_EXPLODE
))
(
avctx
->
err_recognition
&
AV_EF_EXPLODE
))
return
ret
;
goto
fail
;
break
;
break
;
case
DRI
:
case
DRI
:
mjpeg_decode_dri
(
s
);
mjpeg_decode_dri
(
s
);
...
@@ -1756,6 +1756,8 @@ eoi_parser:
...
@@ -1756,6 +1756,8 @@ eoi_parser:
}
}
av_log
(
avctx
,
AV_LOG_FATAL
,
"No JPEG data found in image
\n
"
);
av_log
(
avctx
,
AV_LOG_FATAL
,
"No JPEG data found in image
\n
"
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
fail:
return
ret
;
the_end:
the_end:
if
(
s
->
upscale_h
)
{
if
(
s
->
upscale_h
)
{
uint8_t
*
line
=
s
->
picture_ptr
->
data
[
s
->
upscale_h
];
uint8_t
*
line
=
s
->
picture_ptr
->
data
[
s
->
upscale_h
];
...
...
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