Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
082a8575
Commit
082a8575
authored
14 years ago
by
Stefano Sabatini
Browse files
Options
Downloads
Patches
Plain Diff
Make XAN decoder return meaningful error codes.
Originally committed as revision 25516 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
a3a29c26
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/xan.c
+6
-6
6 additions, 6 deletions
libavcodec/xan.c
with
6 additions
and
6 deletions
libavcodec/xan.c
+
6
−
6
View file @
082a8575
...
@@ -69,7 +69,7 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
...
@@ -69,7 +69,7 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
if
((
avctx
->
codec
->
id
==
CODEC_ID_XAN_WC3
)
&&
if
((
avctx
->
codec
->
id
==
CODEC_ID_XAN_WC3
)
&&
(
s
->
avctx
->
palctrl
==
NULL
))
{
(
s
->
avctx
->
palctrl
==
NULL
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
" WC3 Xan video: palette expected.
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
" WC3 Xan video: palette expected.
\n
"
);
return
-
1
;
return
AVERROR
(
EINVAL
)
;
}
}
avctx
->
pix_fmt
=
PIX_FMT_PAL8
;
avctx
->
pix_fmt
=
PIX_FMT_PAL8
;
...
@@ -77,12 +77,12 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
...
@@ -77,12 +77,12 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
s
->
buffer1_size
=
avctx
->
width
*
avctx
->
height
;
s
->
buffer1_size
=
avctx
->
width
*
avctx
->
height
;
s
->
buffer1
=
av_malloc
(
s
->
buffer1_size
);
s
->
buffer1
=
av_malloc
(
s
->
buffer1_size
);
if
(
!
s
->
buffer1
)
if
(
!
s
->
buffer1
)
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
s
->
buffer2_size
=
avctx
->
width
*
avctx
->
height
;
s
->
buffer2_size
=
avctx
->
width
*
avctx
->
height
;
s
->
buffer2
=
av_malloc
(
s
->
buffer2_size
+
130
);
s
->
buffer2
=
av_malloc
(
s
->
buffer2_size
+
130
);
if
(
!
s
->
buffer2
)
{
if
(
!
s
->
buffer2
)
{
av_freep
(
&
s
->
buffer1
);
av_freep
(
&
s
->
buffer1
);
return
-
1
;
return
AVERROR
(
ENOMEM
)
;
}
}
return
0
;
return
0
;
...
@@ -359,13 +359,13 @@ static int xan_decode_frame(AVCodecContext *avctx,
...
@@ -359,13 +359,13 @@ static int xan_decode_frame(AVCodecContext *avctx,
AVPacket
*
avpkt
)
AVPacket
*
avpkt
)
{
{
const
uint8_t
*
buf
=
avpkt
->
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
int
ret
,
buf_size
=
avpkt
->
size
;
XanContext
*
s
=
avctx
->
priv_data
;
XanContext
*
s
=
avctx
->
priv_data
;
AVPaletteControl
*
palette_control
=
avctx
->
palctrl
;
AVPaletteControl
*
palette_control
=
avctx
->
palctrl
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
current_frame
))
{
if
(
(
ret
=
avctx
->
get_buffer
(
avctx
,
&
s
->
current_frame
))
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" Xan Video: get_buffer() failed
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" Xan Video: get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
}
s
->
current_frame
.
reference
=
3
;
s
->
current_frame
.
reference
=
3
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment