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
0a3589bf
Commit
0a3589bf
authored
Jun 25, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/pngdec: return meaningful error codes
parent
015cc323
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
pngdec.c
libavcodec/pngdec.c
+6
-6
No files found.
libavcodec/pngdec.c
View file @
0a3589bf
...
@@ -368,8 +368,8 @@ static int png_decode_idat(PNGDecContext *s, int length)
...
@@ -368,8 +368,8 @@ static int png_decode_idat(PNGDecContext *s, int length)
while
(
s
->
zstream
.
avail_in
>
0
)
{
while
(
s
->
zstream
.
avail_in
>
0
)
{
ret
=
inflate
(
&
s
->
zstream
,
Z_PARTIAL_FLUSH
);
ret
=
inflate
(
&
s
->
zstream
,
Z_PARTIAL_FLUSH
);
if
(
ret
!=
Z_OK
&&
ret
!=
Z_STREAM_END
)
{
if
(
ret
!=
Z_OK
&&
ret
!=
Z_STREAM_END
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"inflate returned %d
\n
"
,
ret
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"inflate returned
error
%d
\n
"
,
ret
);
return
-
1
;
return
AVERROR_EXTERNAL
;
}
}
if
(
s
->
zstream
.
avail_out
==
0
)
{
if
(
s
->
zstream
.
avail_out
==
0
)
{
if
(
!
(
s
->
state
&
PNG_ALLIMAGE
))
{
if
(
!
(
s
->
state
&
PNG_ALLIMAGE
))
{
...
@@ -519,7 +519,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -519,7 +519,7 @@ static int decode_frame(AVCodecContext *avctx,
if
(
sig
!=
PNGSIG
&&
if
(
sig
!=
PNGSIG
&&
sig
!=
MNGSIG
)
{
sig
!=
MNGSIG
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Missing png signature
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Missing png signature
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
s
->
y
=
s
->
state
=
0
;
s
->
y
=
s
->
state
=
0
;
...
@@ -530,8 +530,8 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -530,8 +530,8 @@ static int decode_frame(AVCodecContext *avctx,
s
->
zstream
.
opaque
=
NULL
;
s
->
zstream
.
opaque
=
NULL
;
ret
=
inflateInit
(
&
s
->
zstream
);
ret
=
inflateInit
(
&
s
->
zstream
);
if
(
ret
!=
Z_OK
)
{
if
(
ret
!=
Z_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"inflateInit returned %d
\n
"
,
ret
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"inflateInit returned
error
%d
\n
"
,
ret
);
return
-
1
;
return
AVERROR_EXTERNAL
;
}
}
for
(;;)
{
for
(;;)
{
if
(
bytestream2_get_bytes_left
(
&
s
->
gb
)
<=
0
)
{
if
(
bytestream2_get_bytes_left
(
&
s
->
gb
)
<=
0
)
{
...
@@ -859,7 +859,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -859,7 +859,7 @@ static int decode_frame(AVCodecContext *avctx,
return
ret
;
return
ret
;
fail
:
fail
:
av_dict_free
(
&
metadata
);
av_dict_free
(
&
metadata
);
ret
=
-
1
;
ret
=
AVERROR_INVALIDDATA
;
goto
the_end
;
goto
the_end
;
}
}
...
...
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