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
0c19b23b
Commit
0c19b23b
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
dpx: return meaningful error codes.
parent
b61e0b99
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/dpx.c
+9
-9
9 additions, 9 deletions
libavcodec/dpx.c
with
9 additions
and
9 deletions
libavcodec/dpx.c
+
9
−
9
View file @
0c19b23b
...
...
@@ -65,7 +65,7 @@ static int decode_frame(AVCodecContext *avctx,
unsigned
int
offset
;
int
magic_num
,
endian
;
int
x
,
y
;
int
x
,
y
,
ret
;
int
w
,
h
,
stride
,
bits_per_color
,
descriptor
,
elements
,
target_packet_size
,
source_packet_size
;
unsigned
int
rgbBuffer
;
...
...
@@ -86,7 +86,7 @@ static int decode_frame(AVCodecContext *avctx,
endian
=
1
;
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"DPX marker not found
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
offset
=
read32
(
&
buf
,
endian
);
...
...
@@ -121,7 +121,7 @@ static int decode_frame(AVCodecContext *avctx,
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported descriptor %d
\n
"
,
descriptor
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
switch
(
bits_per_color
)
{
...
...
@@ -151,18 +151,18 @@ static int decode_frame(AVCodecContext *avctx,
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported color depth : %d
\n
"
,
bits_per_color
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
s
->
picture
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
picture
);
if
(
av_image_check_size
(
w
,
h
,
0
,
avctx
))
return
-
1
;
if
(
(
ret
=
av_image_check_size
(
w
,
h
,
0
,
avctx
))
<
0
)
return
ret
;
if
(
w
!=
avctx
->
width
||
h
!=
avctx
->
height
)
avcodec_set_dimensions
(
avctx
,
w
,
h
);
if
(
ff_get_buffer
(
avctx
,
p
)
<
0
)
{
if
(
(
ret
=
ff_get_buffer
(
avctx
,
p
)
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
ret
;
}
// Move pointer to offset from start of file
...
...
@@ -173,7 +173,7 @@ static int decode_frame(AVCodecContext *avctx,
if
(
source_packet_size
*
avctx
->
width
*
avctx
->
height
>
buf_end
-
buf
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Overread buffer. Invalid header?
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
switch
(
bits_per_color
)
{
case
10
:
...
...
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