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
2b011a43
Commit
2b011a43
authored
Nov 15, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmv: return meaningful error codes.
parent
abcc2354
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
bmv.c
libavcodec/bmv.c
+8
-8
No files found.
libavcodec/bmv.c
View file @
2b011a43
...
...
@@ -67,7 +67,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
int
i
;
if
(
src_len
<=
0
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
if
(
forward
)
{
src
=
source
;
...
...
@@ -91,7 +91,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
*/
if
(
!
mode
||
(
tmplen
==
4
))
{
if
(
src
<
source
||
src
>=
source_end
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
val
=
*
src
;
read_two_nibbles
=
1
;
}
else
{
...
...
@@ -102,7 +102,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
for
(;;)
{
if
(
!
read_two_nibbles
)
{
if
(
src
<
source
||
src
>=
source_end
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
shift
+=
2
;
val
|=
*
src
<<
shift
;
if
(
*
src
&
0xC
)
...
...
@@ -137,7 +137,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
if
(
mode
>=
4
)
mode
-=
3
;
if
(
FFABS
(
dst_end
-
dst
)
<
len
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
switch
(
mode
)
{
case
1
:
if
(
forward
)
{
...
...
@@ -145,7 +145,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
dst
-
frame
+
SCREEN_WIDE
+
frame_off
<
0
||
frame_end
-
dst
<
frame_off
+
len
||
frame_end
-
dst
<
len
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
len
;
i
++
)
dst
[
i
]
=
dst
[
frame_off
+
i
];
dst
+=
len
;
...
...
@@ -155,7 +155,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
dst
-
frame
+
SCREEN_WIDE
+
frame_off
<
0
||
frame_end
-
dst
<
frame_off
+
len
||
frame_end
-
dst
<
len
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
len
-
1
;
i
>=
0
;
i
--
)
dst
[
i
]
=
dst
[
frame_off
+
i
];
}
...
...
@@ -163,13 +163,13 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
case
2
:
if
(
forward
)
{
if
(
source
+
src_len
-
src
<
len
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
memcpy
(
dst
,
src
,
len
);
dst
+=
len
;
src
+=
len
;
}
else
{
if
(
src
-
source
<
len
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
dst
-=
len
;
src
-=
len
;
memcpy
(
dst
,
src
,
len
);
...
...
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