Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
a590dfc2
Commit
a590dfc2
authored
Sep 03, 2021
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/interplayacm: fix draining and last frame number of samples
parent
584cd16a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
interplayacm.c
libavcodec/interplayacm.c
+8
-3
No files found.
libavcodec/interplayacm.c
View file @
a590dfc2
...
...
@@ -39,6 +39,7 @@ typedef struct InterplayACMContext {
GetBitContext
gb
;
uint8_t
*
bitstream
;
int
max_framesize
;
uint64_t
max_samples
;
int
bitstream_size
;
int
bitstream_index
;
...
...
@@ -83,6 +84,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
return
AVERROR_INVALIDDATA
;
}
s
->
max_samples
=
AV_RL32
(
avctx
->
extradata
+
4
)
/
avctx
->
channels
;
if
(
s
->
max_samples
==
0
)
s
->
max_samples
=
UINT64_MAX
;
s
->
level
=
AV_RL16
(
avctx
->
extradata
+
12
)
&
0xf
;
s
->
rows
=
AV_RL16
(
avctx
->
extradata
+
12
)
>>
4
;
s
->
cols
=
1
<<
s
->
level
;
...
...
@@ -581,7 +585,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if
((
ret
=
init_get_bits8
(
gb
,
buf
,
buf_size
))
<
0
)
return
ret
;
frame
->
nb_samples
=
s
->
block_len
/
avctx
->
channels
;
frame
->
nb_samples
=
FFMIN
(
s
->
block_len
/
avctx
->
channels
,
s
->
max_samples
);
s
->
max_samples
-=
FFMIN
(
frame
->
nb_samples
,
s
->
max_samples
);
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
,
0
))
<
0
)
return
ret
;
...
...
@@ -606,9 +611,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return
AVERROR_INVALIDDATA
;
}
if
(
s
->
bitstream_size
)
{
if
(
s
->
bitstream_size
>
0
)
{
s
->
bitstream_index
+=
n
;
s
->
bitstream_size
-=
n
;
s
->
bitstream_size
-=
FFMIN
(
s
->
bitstream_size
,
n
)
;
return
input_buf_size
;
}
return
n
;
...
...
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