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
999ccd2d
Commit
999ccd2d
authored
Jun 03, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiff: cleanup the error paths
Return the proper error values and optionally report them.
parent
016c5b06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
tiff.c
libavcodec/tiff.c
+15
-10
No files found.
libavcodec/tiff.c
View file @
999ccd2d
...
...
@@ -156,10 +156,9 @@ static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
return
AVERROR
(
ENOMEM
);
}
if
(
s
->
fax_opts
&
2
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Uncompressed fax mode is not supported (yet)
\n
"
);
avpriv_request_sample
(
s
->
avctx
,
"Uncompressed fax mode"
);
av_free
(
src2
);
return
AVERROR_
INVALIDDATA
;
return
AVERROR_
PATCHWELCOME
;
}
if
(
!
s
->
fill_order
)
{
memcpy
(
src2
,
src
,
size
);
...
...
@@ -437,8 +436,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start,
#endif
case
TIFF_JPEG
:
case
TIFF_NEWJPEG
:
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"JPEG compression is not supported
\n
"
);
avpriv_report_missing_feature
(
s
->
avctx
,
"JPEG compression"
);
return
AVERROR_PATCHWELCOME
;
default:
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Unknown compression method %i
\n
"
,
...
...
@@ -535,7 +533,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start,
break
;
case
TIFF_PLANAR
:
if
(
value
==
2
)
{
av
_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Planar format is not supported
\n
"
);
av
priv_report_missing_feature
(
s
->
avctx
,
"Planar format
"
);
return
AVERROR_PATCHWELCOME
;
}
break
;
...
...
@@ -548,8 +546,12 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start,
s
->
fax_opts
=
value
;
break
;
default:
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"Unknown or unsupported tag %d/0X%0X
\n
"
,
tag
,
tag
);
if
(
s
->
avctx
->
err_recognition
&
AV_EF_EXPLODE
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Unknown or unsupported tag %d/0X%0X
\n
"
,
tag
,
tag
);
return
AVERROR_INVALIDDATA
;
}
}
return
0
;
}
...
...
@@ -640,9 +642,12 @@ static int decode_frame(AVCodecContext *avctx,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid strip size/offset
\n
"
);
return
AVERROR_INVALIDDATA
;
}
if
(
tiff_unpack_strip
(
s
,
dst
,
stride
,
orig_buf
+
soff
,
ssize
,
FFMIN
(
s
->
rps
,
s
->
height
-
i
))
<
0
)
if
((
ret
=
tiff_unpack_strip
(
s
,
dst
,
stride
,
orig_buf
+
soff
,
ssize
,
FFMIN
(
s
->
rps
,
s
->
height
-
i
)))
<
0
)
{
if
(
avctx
->
err_recognition
&
AV_EF_EXPLODE
)
return
ret
;
break
;
}
dst
+=
s
->
rps
*
stride
;
}
if
(
s
->
predictor
==
2
)
{
...
...
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