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
8a8cce07
Commit
8a8cce07
authored
Dec 23, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/au: do not use invalid block_align for small bits per sample
Fixes #5481.
parent
3e461f9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
au.c
libavformat/au.c
+3
-2
No files found.
libavformat/au.c
View file @
8a8cce07
...
...
@@ -140,7 +140,7 @@ static int au_read_header(AVFormatContext *s)
unsigned
int
tag
;
AVIOContext
*
pb
=
s
->
pb
;
unsigned
int
id
,
channels
,
rate
;
int
bps
;
int
bps
,
ba
=
0
;
enum
AVCodecID
codec
;
AVStream
*
st
;
...
...
@@ -178,6 +178,7 @@ static int au_read_header(AVFormatContext *s)
}
else
{
const
uint8_t
bpcss
[]
=
{
4
,
0
,
3
,
5
};
av_assert0
(
id
>=
23
&&
id
<
23
+
4
);
ba
=
bpcss
[
id
-
23
];
bps
=
bpcss
[
id
-
23
];
}
}
else
if
(
!
bps
)
{
...
...
@@ -205,7 +206,7 @@ static int au_read_header(AVFormatContext *s)
st
->
codecpar
->
sample_rate
=
rate
;
st
->
codecpar
->
bits_per_coded_sample
=
bps
;
st
->
codecpar
->
bit_rate
=
channels
*
rate
*
bps
;
st
->
codecpar
->
block_align
=
FFMAX
(
bps
*
st
->
codecpar
->
channels
/
8
,
1
);
st
->
codecpar
->
block_align
=
ba
?
ba
:
FFMAX
(
bps
*
st
->
codecpar
->
channels
/
8
,
1
);
if
(
data_size
!=
AU_UNKNOWN_SIZE
)
st
->
duration
=
(((
int64_t
)
data_size
)
<<
3
)
/
(
st
->
codecpar
->
channels
*
(
int64_t
)
bps
);
...
...
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