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
68e3c9a3
Commit
68e3c9a3
authored
Mar 25, 2017
by
Dzung Hoang
Committed by
Paul B Mahol
Apr 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/exr: add support for scanline file where offsets are set to zero
parent
75afad77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
exr.c
libavcodec/exr.c
+18
-1
No files found.
libavcodec/exr.c
View file @
68e3c9a3
...
...
@@ -1647,7 +1647,10 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int
y
,
ret
;
int
out_line_size
;
int
nb_blocks
;
/* nb scanline or nb tile */
int
nb_blocks
;
/* nb scanline or nb tile */
uint64_t
*
table
;
/* scanline offset table */
uint8_t
*
marker
;
/* used to recreate invalid scanline offset table */
uint8_t
*
head
;
bytestream2_init
(
&
s
->
gb
,
avpkt
->
data
,
avpkt
->
size
);
...
...
@@ -1733,6 +1736,20 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if
(
bytestream2_get_bytes_left
(
&
s
->
gb
)
<
nb_blocks
*
8
)
return
AVERROR_INVALIDDATA
;
// check offset table and recreate it if need
if
(
!
s
->
is_tile
&&
bytestream2_peek_le64
(
&
s
->
gb
)
==
0
)
{
head
=
avpkt
->
data
;
table
=
(
uint64_t
*
)
s
->
gb
.
buffer
;
marker
=
head
+
bytestream2_tell
(
&
s
->
gb
)
+
nb_blocks
*
8
;
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"recreating invalid scanline offset table
\n
"
);
for
(
y
=
0
;
y
<
nb_blocks
;
y
++
)
{
table
[
y
]
=
marker
-
head
;
marker
+=
((
uint32_t
*
)
marker
)[
1
]
+
8
;
}
}
// save pointer we are going to use in decode_block
s
->
buf
=
avpkt
->
data
;
s
->
buf_size
=
avpkt
->
size
;
...
...
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