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
cc0bd784
Commit
cc0bd784
authored
Feb 20, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exr: support more line orders
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
11788686
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
exr.c
libavcodec/exr.c
+11
-5
No files found.
libavcodec/exr.c
View file @
cc0bd784
...
@@ -378,9 +378,10 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -378,9 +378,10 @@ static int decode_frame(AVCodecContext *avctx,
if
(
!
variable_buffer_data_size
)
if
(
!
variable_buffer_data_size
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
if
(
*
buf
)
{
av_log
(
avctx
,
AV_LOG_DEBUG
,
"line order : %d
\n
"
,
*
buf
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Doesn't support this line order : %d
\n
"
,
*
buf
);
if
(
*
buf
>
2
)
{
return
AVERROR_PATCHWELCOME
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown line order
\n
"
);
return
AVERROR_INVALIDDATA
;
}
}
buf
+=
variable_buffer_data_size
;
buf
+=
variable_buffer_data_size
;
...
@@ -518,17 +519,21 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -518,17 +519,21 @@ static int decode_frame(AVCodecContext *avctx,
// Process the actual scan line blocks
// Process the actual scan line blocks
for
(
y
=
ymin
;
y
<=
ymax
;
y
+=
scan_lines_per_block
)
{
for
(
y
=
ymin
;
y
<=
ymax
;
y
+=
scan_lines_per_block
)
{
uint16_t
*
ptr_x
=
(
uint16_t
*
)
ptr
;
uint16_t
*
ptr_x
;
if
(
buf_end
-
buf
>
8
)
{
if
(
buf_end
-
buf
>
8
)
{
const
uint8_t
*
red_channel_buffer
,
*
green_channel_buffer
,
*
blue_channel_buffer
,
*
alpha_channel_buffer
=
0
;
const
uint8_t
*
red_channel_buffer
,
*
green_channel_buffer
,
*
blue_channel_buffer
,
*
alpha_channel_buffer
=
0
;
const
uint64_t
line_offset
=
bytestream_get_le64
(
&
buf
);
const
uint64_t
line_offset
=
bytestream_get_le64
(
&
buf
);
int32_t
data_size
;
int32_t
data_size
,
line
;
// Check if the buffer has the required bytes needed from the offset
// Check if the buffer has the required bytes needed from the offset
if
(
line_offset
>
(
uint64_t
)
buf_size
-
8
)
if
(
line_offset
>
(
uint64_t
)
buf_size
-
8
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
src
=
avpkt
->
data
+
line_offset
+
8
;
src
=
avpkt
->
data
+
line_offset
+
8
;
line
=
AV_RL32
(
src
-
8
);
if
(
line
<
ymin
||
line
>
ymax
)
return
AVERROR_INVALIDDATA
;
data_size
=
AV_RL32
(
src
-
4
);
data_size
=
AV_RL32
(
src
-
4
);
if
(
data_size
<=
0
||
data_size
>
buf_size
)
if
(
data_size
<=
0
||
data_size
>
buf_size
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
...
@@ -573,6 +578,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -573,6 +578,7 @@ static int decode_frame(AVCodecContext *avctx,
alpha_channel_buffer
=
src
+
xdelta
*
s
->
channel_offsets
[
3
];
alpha_channel_buffer
=
src
+
xdelta
*
s
->
channel_offsets
[
3
];
}
}
ptr
=
p
->
data
[
0
]
+
line
*
stride
;
for
(
i
=
0
;
i
<
scan_lines_per_block
&&
y
+
i
<=
ymax
;
i
++
,
ptr
+=
stride
)
{
for
(
i
=
0
;
i
<
scan_lines_per_block
&&
y
+
i
<=
ymax
;
i
++
,
ptr
+=
stride
)
{
const
uint8_t
*
r
,
*
g
,
*
b
,
*
a
;
const
uint8_t
*
r
,
*
g
,
*
b
,
*
a
;
...
...
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