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
cfa7709d
Commit
cfa7709d
authored
Dec 28, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/wavpack: fix decoding of files with many channels
Fixes decoding of Run_The_Race_-_3rd_Order_Ambisonic_SN3D.wv
parent
1a6cca19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
wavpack.c
libavcodec/wavpack.c
+14
-4
wvdec.c
libavformat/wvdec.c
+8
-1
No files found.
libavcodec/wavpack.c
View file @
cfa7709d
...
...
@@ -940,13 +940,23 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
case
3
:
chmask
=
bytestream2_get_le32
(
&
gb
);
break
;
case
5
:
case
4
:
size
=
bytestream2_get_byte
(
&
gb
);
if
(
avctx
->
channels
!=
size
)
chan
|=
(
bytestream2_get_byte
(
&
gb
)
&
0xF
)
<<
8
;
chan
+=
1
;
if
(
avctx
->
channels
!=
chan
)
av_log
(
avctx
,
AV_LOG_WARNING
,
"%i channels signalled"
" instead of %i.
\n
"
,
size
,
avctx
->
channels
);
" instead of %i.
\n
"
,
chan
,
avctx
->
channels
);
chmask
=
bytestream2_get_le24
(
&
gb
);
break
;
case
5
:
size
=
bytestream2_get_byte
(
&
gb
);
chan
|=
(
bytestream2_get_byte
(
&
gb
)
&
0xF
)
<<
8
;
chmask
=
bytestream2_get_le16
(
&
gb
);
chan
+=
1
;
if
(
avctx
->
channels
!=
chan
)
av_log
(
avctx
,
AV_LOG_WARNING
,
"%i channels signalled"
" instead of %i.
\n
"
,
chan
,
avctx
->
channels
);
chmask
=
bytestream2_get_le32
(
&
gb
);
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid channel info size %d
\n
"
,
...
...
libavformat/wvdec.c
View file @
cfa7709d
...
...
@@ -153,11 +153,18 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb)
case
3
:
chmask
=
avio_rl32
(
pb
);
break
;
case
5
:
case
4
:
avio_skip
(
pb
,
1
);
chan
|=
(
avio_r8
(
pb
)
&
0xF
)
<<
8
;
chan
+=
1
;
chmask
=
avio_rl24
(
pb
);
break
;
case
5
:
avio_skip
(
pb
,
1
);
chan
|=
(
avio_r8
(
pb
)
&
0xF
)
<<
8
;
chan
+=
1
;
chmask
=
avio_rl32
(
pb
);
break
;
default:
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid channel info size %d
\n
"
,
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