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
634c01bc
Commit
634c01bc
authored
Apr 06, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exr: fix av_logs()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b7ce3242
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
exr.c
libavcodec/exr.c
+15
-15
No files found.
libavcodec/exr.c
View file @
634c01bc
...
@@ -174,7 +174,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -174,7 +174,7 @@ static int decode_frame(AVCodecContext *avctx,
magic_number
=
bytestream_get_le32
(
&
buf
);
magic_number
=
bytestream_get_le32
(
&
buf
);
if
(
magic_number
!=
20000630
)
{
// As per documentation of OpenEXR it's supposed to be int 20000630 little-endian
if
(
magic_number
!=
20000630
)
{
// As per documentation of OpenEXR it's supposed to be int 20000630 little-endian
av_log
(
avctx
,
AV
ERROR_INVALIDDATA
,
"Wrong magic number %d
\n
"
,
magic_number
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Wrong magic number %d
\n
"
,
magic_number
);
return
-
1
;
return
-
1
;
}
}
...
@@ -214,19 +214,19 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -214,19 +214,19 @@ static int decode_frame(AVCodecContext *avctx,
continue
;
/* skip */
continue
;
/* skip */
if
(
channel_list_end
-
*
&
buf
<
4
)
{
if
(
channel_list_end
-
*
&
buf
<
4
)
{
av_log
(
avctx
,
AV
ERROR_INVALIDDATA
,
"Incomplete header
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Incomplete header
\n
"
);
return
-
1
;
return
-
1
;
}
}
current_bits_per_color_id
=
bytestream_get_le32
(
&
buf
);
current_bits_per_color_id
=
bytestream_get_le32
(
&
buf
);
if
(
current_bits_per_color_id
>
2
)
{
if
(
current_bits_per_color_id
>
2
)
{
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"Unknown color format
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Unknown color format
\n
"
);
return
-
1
;
return
-
1
;
}
}
if
(
channel_index
>=
0
)
{
if
(
channel_index
>=
0
)
{
if
(
s
->
bits_per_color_id
!=
-
1
&&
s
->
bits_per_color_id
!=
current_bits_per_color_id
)
{
if
(
s
->
bits_per_color_id
!=
-
1
&&
s
->
bits_per_color_id
!=
current_bits_per_color_id
)
{
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"RGB channels not of the same depth
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"RGB channels not of the same depth
\n
"
);
return
-
1
;
return
-
1
;
}
}
s
->
bits_per_color_id
=
current_bits_per_color_id
;
s
->
bits_per_color_id
=
current_bits_per_color_id
;
...
@@ -244,11 +244,11 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -244,11 +244,11 @@ static int decode_frame(AVCodecContext *avctx,
s
->
channel_offsets
[
1
],
s
->
channel_offsets
[
1
],
s
->
channel_offsets
[
2
])
<
0
)
{
s
->
channel_offsets
[
2
])
<
0
)
{
if
(
s
->
channel_offsets
[
0
]
<
0
)
if
(
s
->
channel_offsets
[
0
]
<
0
)
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"Missing red channel
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Missing red channel
\n
"
);
if
(
s
->
channel_offsets
[
1
]
<
0
)
if
(
s
->
channel_offsets
[
1
]
<
0
)
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"Missing green channel
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Missing green channel
\n
"
);
if
(
s
->
channel_offsets
[
2
]
<
0
)
if
(
s
->
channel_offsets
[
2
]
<
0
)
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"Missing blue channel
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Missing blue channel
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -289,7 +289,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -289,7 +289,7 @@ static int decode_frame(AVCodecContext *avctx,
return
-
1
;
return
-
1
;
if
(
*
buf
)
{
if
(
*
buf
)
{
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"Doesn't support this line order : %d
\n
"
,
*
buf
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Doesn't support this line order : %d
\n
"
,
*
buf
);
return
-
1
;
return
-
1
;
}
}
...
@@ -312,7 +312,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -312,7 +312,7 @@ static int decode_frame(AVCodecContext *avctx,
case
EXR_PIZ
:
case
EXR_PIZ
:
case
EXR_B44
:
case
EXR_B44
:
default:
default:
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"This type of compression is not supported
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"This type of compression is not supported
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -322,7 +322,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -322,7 +322,7 @@ static int decode_frame(AVCodecContext *avctx,
// Check if there is enough bytes for a header
// Check if there is enough bytes for a header
if
(
buf_end
-
buf
<=
9
)
{
if
(
buf_end
-
buf
<=
9
)
{
av_log
(
avctx
,
AV
ERROR_INVALIDDATA
,
"Incomplete header
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Incomplete header
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -338,7 +338,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -338,7 +338,7 @@ static int decode_frame(AVCodecContext *avctx,
if
(
buf_end
-
buf
>=
5
)
{
if
(
buf_end
-
buf
>=
5
)
{
variable_buffer_data_size
=
get_header_variable_length
(
&
buf
,
buf_end
);
variable_buffer_data_size
=
get_header_variable_length
(
&
buf
,
buf_end
);
if
(
!
variable_buffer_data_size
)
{
if
(
!
variable_buffer_data_size
)
{
av_log
(
avctx
,
AV
ERROR_INVALIDDATA
,
"Incomplete header
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Incomplete header
\n
"
);
return
-
1
;
return
-
1
;
}
}
buf
+=
variable_buffer_data_size
;
buf
+=
variable_buffer_data_size
;
...
@@ -346,7 +346,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -346,7 +346,7 @@ static int decode_frame(AVCodecContext *avctx,
}
}
if
(
buf
>=
buf_end
)
{
if
(
buf
>=
buf_end
)
{
av_log
(
avctx
,
AV
ERROR_EOF
,
"Incomplete fil
e
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Incomplete fram
e
\n
"
);
return
-
1
;
return
-
1
;
}
}
buf
++
;
buf
++
;
...
@@ -361,7 +361,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -361,7 +361,7 @@ static int decode_frame(AVCodecContext *avctx,
av_log_missing_feature
(
avctx
,
"8-bit OpenEXR"
,
1
);
av_log_missing_feature
(
avctx
,
"8-bit OpenEXR"
,
1
);
return
-
1
;
return
-
1
;
default:
default:
av_log
(
avctx
,
AV
ERROR_NOFMT
,
"Unknown color format : %d
\n
"
,
s
->
bits_per_color_id
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Unknown color format : %d
\n
"
,
s
->
bits_per_color_id
);
return
-
1
;
return
-
1
;
}
}
...
@@ -376,7 +376,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -376,7 +376,7 @@ static int decode_frame(AVCodecContext *avctx,
ymin
>
h
||
ymin
==
~
0
||
ymin
>
h
||
ymin
==
~
0
||
ymax
>
h
||
ymax
==
~
0
||
ymax
>
h
||
ymax
==
~
0
||
xdelta
==
~
0
)
{
xdelta
==
~
0
)
{
av_log
(
avctx
,
AV
ERROR_INVALIDDATA
,
"Wrong sizing or missing size information
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"Wrong sizing or missing size information
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -385,7 +385,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -385,7 +385,7 @@ static int decode_frame(AVCodecContext *avctx,
}
}
if
(
avctx
->
get_buffer
(
avctx
,
p
)
<
0
)
{
if
(
avctx
->
get_buffer
(
avctx
,
p
)
<
0
)
{
av_log
(
avctx
,
AV
ERROR_IO
,
"get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV
_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
...
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