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
c466eb17
Commit
c466eb17
authored
Oct 10, 2012
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flashsv: propagate inflateReset() errors
Fixes CID717493.
parent
6d556e83
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
flashsv.c
libavcodec/flashsv.c
+14
-5
No files found.
libavcodec/flashsv.c
View file @
c466eb17
...
@@ -121,10 +121,11 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
...
@@ -121,10 +121,11 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
}
}
static
void
flashsv2_prime
(
FlashSVContext
*
s
,
uint8_t
*
src
,
static
int
flashsv2_prime
(
FlashSVContext
*
s
,
uint8_t
*
src
,
int
size
,
int
unp_size
)
int
size
,
int
unp_size
)
{
{
z_stream
zs
;
z_stream
zs
;
int
zret
;
// Zlib return code
zs
.
zalloc
=
NULL
;
zs
.
zalloc
=
NULL
;
zs
.
zfree
=
NULL
;
zs
.
zfree
=
NULL
;
...
@@ -144,13 +145,18 @@ static void flashsv2_prime(FlashSVContext *s, uint8_t *src,
...
@@ -144,13 +145,18 @@ static void flashsv2_prime(FlashSVContext *s, uint8_t *src,
deflate
(
&
zs
,
Z_SYNC_FLUSH
);
deflate
(
&
zs
,
Z_SYNC_FLUSH
);
deflateEnd
(
&
zs
);
deflateEnd
(
&
zs
);
inflateReset
(
&
s
->
zstream
);
if
((
zret
=
inflateReset
(
&
s
->
zstream
))
!=
Z_OK
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Inflate reset error: %d
\n
"
,
zret
);
return
AVERROR_UNKNOWN
;
}
s
->
zstream
.
next_in
=
s
->
deflate_block
;
s
->
zstream
.
next_in
=
s
->
deflate_block
;
s
->
zstream
.
avail_in
=
s
->
deflate_block_size
-
zs
.
avail_out
;
s
->
zstream
.
avail_in
=
s
->
deflate_block_size
-
zs
.
avail_out
;
s
->
zstream
.
next_out
=
s
->
tmpblock
;
s
->
zstream
.
next_out
=
s
->
tmpblock
;
s
->
zstream
.
avail_out
=
s
->
block_size
*
3
;
s
->
zstream
.
avail_out
=
s
->
block_size
*
3
;
inflate
(
&
s
->
zstream
,
Z_SYNC_FLUSH
);
inflate
(
&
s
->
zstream
,
Z_SYNC_FLUSH
);
return
0
;
}
}
static
int
flashsv_decode_block
(
AVCodecContext
*
avctx
,
AVPacket
*
avpkt
,
static
int
flashsv_decode_block
(
AVCodecContext
*
avctx
,
AVPacket
*
avpkt
,
...
@@ -163,11 +169,14 @@ static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt,
...
@@ -163,11 +169,14 @@ static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt,
int
k
;
int
k
;
int
ret
=
inflateReset
(
&
s
->
zstream
);
int
ret
=
inflateReset
(
&
s
->
zstream
);
if
(
ret
!=
Z_OK
)
{
if
(
ret
!=
Z_OK
)
{
//return -1;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Inflate reset error: %d
\n
"
,
ret
);
return
AVERROR_UNKNOWN
;
}
}
if
(
s
->
zlibprime_curr
||
s
->
zlibprime_prev
)
{
if
(
s
->
zlibprime_curr
||
s
->
zlibprime_prev
)
{
flashsv2_prime
(
s
,
s
->
blocks
[
blk_idx
].
pos
,
s
->
blocks
[
blk_idx
].
size
,
ret
=
flashsv2_prime
(
s
,
s
->
blocks
[
blk_idx
].
pos
,
s
->
blocks
[
blk_idx
].
size
,
s
->
blocks
[
blk_idx
].
unp_size
);
s
->
blocks
[
blk_idx
].
unp_size
);
if
(
ret
<
0
)
return
ret
;
}
}
s
->
zstream
.
next_in
=
avpkt
->
data
+
get_bits_count
(
gb
)
/
8
;
s
->
zstream
.
next_in
=
avpkt
->
data
+
get_bits_count
(
gb
)
/
8
;
s
->
zstream
.
avail_in
=
block_size
;
s
->
zstream
.
avail_in
=
block_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