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
6ab681a4
Commit
6ab681a4
authored
Feb 09, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ttadec: fix invalid free when an error occurs while decoding 24-bit tta
parent
9d7cee50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
tta.c
libavcodec/tta.c
+17
-6
No files found.
libavcodec/tta.c
View file @
6ab681a4
...
...
@@ -339,12 +339,16 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
unary
--
;
}
if
(
get_bits_left
(
&
s
->
gb
)
<
k
)
return
-
1
;
if
(
get_bits_left
(
&
s
->
gb
)
<
k
)
{
ret
=
AVERROR_INVALIDDATA
;
goto
error
;
}
if
(
k
)
{
if
(
k
>
MIN_CACHE_BITS
)
return
-
1
;
if
(
k
>
MIN_CACHE_BITS
)
{
ret
=
AVERROR_INVALIDDATA
;
goto
error
;
}
value
=
(
unary
<<
k
)
+
get_bits
(
&
s
->
gb
,
k
);
}
else
value
=
unary
;
...
...
@@ -397,8 +401,10 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
}
}
if
(
get_bits_left
(
&
s
->
gb
)
<
32
)
return
-
1
;
if
(
get_bits_left
(
&
s
->
gb
)
<
32
)
{
ret
=
AVERROR_INVALIDDATA
;
goto
error
;
}
skip_bits_long
(
&
s
->
gb
,
32
);
// frame crc
// convert to output buffer
...
...
@@ -419,6 +425,11 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
*
(
AVFrame
*
)
data
=
s
->
frame
;
return
buf_size
;
error:
// reset decode buffer
if
(
s
->
bps
==
3
)
s
->
decode_buffer
=
NULL
;
return
ret
;
}
static
av_cold
int
tta_decode_close
(
AVCodecContext
*
avctx
)
{
...
...
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