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
4aebb8d9
Commit
4aebb8d9
authored
Nov 16, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xxan: return meaningful error codes.
parent
aaf20832
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
xxan.c
libavcodec/xxan.c
+6
-6
No files found.
libavcodec/xxan.c
View file @
4aebb8d9
...
...
@@ -133,7 +133,7 @@ static int xan_unpack(XanContext *s,
}
if
(
dest
+
size
+
size2
>
dest_end
||
dest
-
orig_dest
+
size
<
back
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
bytestream2_get_buffer
(
&
s
->
gb
,
dest
,
size
);
dest
+=
size
;
av_memcpy_backptr
(
dest
,
back
,
size2
);
...
...
@@ -143,7 +143,7 @@ static int xan_unpack(XanContext *s,
size
=
finish
?
opcode
&
3
:
((
opcode
&
0x1f
)
<<
2
)
+
4
;
if
(
dest_end
-
dest
<
size
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
bytestream2_get_buffer
(
&
s
->
gb
,
dest
,
size
);
dest
+=
size
;
if
(
finish
)
...
...
@@ -167,7 +167,7 @@ static int xan_decode_chroma(AVCodecContext *avctx, unsigned chroma_off)
return
0
;
if
(
chroma_off
+
4
>=
bytestream2_get_bytes_left
(
&
s
->
gb
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid chroma block position
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
bytestream2_seek
(
&
s
->
gb
,
chroma_off
+
4
,
SEEK_SET
);
mode
=
bytestream2_get_le16
(
&
s
->
gb
);
...
...
@@ -178,7 +178,7 @@ static int xan_decode_chroma(AVCodecContext *avctx, unsigned chroma_off)
if
(
offset
>=
bytestream2_get_bytes_left
(
&
s
->
gb
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid chroma block offset
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
bytestream2_skip
(
&
s
->
gb
,
offset
);
...
...
@@ -186,7 +186,7 @@ static int xan_decode_chroma(AVCodecContext *avctx, unsigned chroma_off)
dec_size
=
xan_unpack
(
s
,
s
->
scratch_buffer
,
s
->
buffer_size
);
if
(
dec_size
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Chroma unpacking failed
\n
"
);
return
-
1
;
return
dec_size
;
}
U
=
s
->
pic
.
data
[
1
];
...
...
@@ -384,7 +384,7 @@ static int xan_decode_frame(AVCodecContext *avctx,
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown frame type %d
\n
"
,
ftype
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
ret
)
return
ret
;
...
...
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