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
ac1e93f5
Commit
ac1e93f5
authored
Nov 20, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tscc: return meaningful error codes.
parent
b627c301
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
tscc.c
libavcodec/tscc.c
+8
-8
No files found.
libavcodec/tscc.c
View file @
ac1e93f5
...
...
@@ -79,22 +79,22 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
CamtasiaContext
*
const
c
=
avctx
->
priv_data
;
const
unsigned
char
*
encoded
=
buf
;
int
zret
;
// Zlib return code
int
len
=
buf_size
;
int
ret
,
len
=
buf_size
;
if
(
c
->
pic
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
c
->
pic
);
c
->
pic
.
reference
=
1
;
c
->
pic
.
buffer_hints
=
FF_BUFFER_HINTS_VALID
;
if
(
ff_get_buffer
(
avctx
,
&
c
->
pic
)
<
0
){
if
((
ret
=
ff_get_buffer
(
avctx
,
&
c
->
pic
)
)
<
0
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
zret
=
inflateReset
(
&
c
->
zstream
);
if
(
zret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate reset error: %d
\n
"
,
zret
);
return
-
1
;
return
AVERROR_UNKNOWN
;
}
c
->
zstream
.
next_in
=
encoded
;
c
->
zstream
.
avail_in
=
len
;
...
...
@@ -104,7 +104,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
// Z_DATA_ERROR means empty picture
if
((
zret
!=
Z_OK
)
&&
(
zret
!=
Z_STREAM_END
)
&&
(
zret
!=
Z_DATA_ERROR
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate error: %d
\n
"
,
zret
);
return
-
1
;
return
AVERROR_UNKNOWN
;
}
...
...
@@ -158,7 +158,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
break
;
case
32
:
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB32
;
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Camtasia error: unknown depth %i bpp
\n
"
,
avctx
->
bits_per_coded_sample
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
c
->
bpp
=
avctx
->
bits_per_coded_sample
;
// buffer size for RLE 'best' case when 2-byte code precedes each pixel and there may be padding after it too
...
...
@@ -168,7 +168,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
if
(
c
->
decomp_size
)
{
if
((
c
->
decomp_buf
=
av_malloc
(
c
->
decomp_size
))
==
NULL
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Can't allocate decompression buffer.
\n
"
);
return
1
;
return
AVERROR
(
ENOMEM
)
;
}
}
...
...
@@ -178,7 +178,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
zret
=
inflateInit
(
&
c
->
zstream
);
if
(
zret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate init error: %d
\n
"
,
zret
);
return
1
;
return
AVERROR_UNKNOWN
;
}
return
0
;
...
...
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