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
089b3d68
Commit
089b3d68
authored
Nov 19, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interplayvideo: return meaningful error codes.
parent
14cf33e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
interplayvideo.c
libavcodec/interplayvideo.c
+5
-4
No files found.
libavcodec/interplayvideo.c
View file @
089b3d68
...
@@ -74,11 +74,11 @@ static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y)
...
@@ -74,11 +74,11 @@ static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y)
+
delta_x
*
(
1
+
s
->
is_16bpp
);
+
delta_x
*
(
1
+
s
->
is_16bpp
);
if
(
motion_offset
<
0
)
{
if
(
motion_offset
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" Interplay video: motion offset < 0 (%d)
\n
"
,
motion_offset
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" Interplay video: motion offset < 0 (%d)
\n
"
,
motion_offset
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
else
if
(
motion_offset
>
s
->
upper_motion_limit_offset
)
{
}
else
if
(
motion_offset
>
s
->
upper_motion_limit_offset
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" Interplay video: motion offset above limit (%d >= %d)
\n
"
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" Interplay video: motion offset above limit (%d >= %d)
\n
"
,
motion_offset
,
s
->
upper_motion_limit_offset
);
motion_offset
,
s
->
upper_motion_limit_offset
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
src
->
data
[
0
]
==
NULL
)
{
if
(
src
->
data
[
0
]
==
NULL
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Invalid decode type, corrupted header?
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Invalid decode type, corrupted header?
\n
"
);
...
@@ -959,6 +959,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
...
@@ -959,6 +959,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
const
uint8_t
*
buf
=
avpkt
->
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
IpvideoContext
*
s
=
avctx
->
priv_data
;
IpvideoContext
*
s
=
avctx
->
priv_data
;
int
ret
;
/* decoding map contains 4 bits of information per 8x8 block */
/* decoding map contains 4 bits of information per 8x8 block */
s
->
decoding_map_size
=
avctx
->
width
*
avctx
->
height
/
(
8
*
8
*
2
);
s
->
decoding_map_size
=
avctx
->
width
*
avctx
->
height
/
(
8
*
8
*
2
);
...
@@ -973,9 +974,9 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
...
@@ -973,9 +974,9 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
buf_size
-
s
->
decoding_map_size
);
buf_size
-
s
->
decoding_map_size
);
s
->
current_frame
.
reference
=
3
;
s
->
current_frame
.
reference
=
3
;
if
(
ff_get_buffer
(
avctx
,
&
s
->
current_frame
)
)
{
if
(
(
ret
=
ff_get_buffer
(
avctx
,
&
s
->
current_frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
" Interplay Video: get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
" Interplay Video: get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
}
if
(
!
s
->
is_16bpp
)
{
if
(
!
s
->
is_16bpp
)
{
...
...
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