Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
42895b2c
Commit
42895b2c
authored
5 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Make error messages consistent
parent
218fdaea
No related branches found
No related tags found
1 merge request
!675
PNG conversion refactoring
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/r_picformats.c
+6
-12
6 additions, 12 deletions
src/r_picformats.c
with
6 additions
and
12 deletions
src/r_picformats.c
+
6
−
12
View file @
42895b2c
...
...
@@ -806,13 +806,13 @@ static png_bytep *PNG_Read(const UINT8 *png, INT32 *w, INT32 *h, INT16 *topoffse
png_ptr
=
png_create_read_struct
(
PNG_LIBPNG_VER_STRING
,
NULL
,
PNG_error
,
PNG_warn
);
if
(
!
png_ptr
)
I_Error
(
"PNG_
Lo
ad: Couldn't initialize libpng!"
);
I_Error
(
"PNG_
Re
ad: Couldn't initialize libpng!"
);
png_info_ptr
=
png_create_info_struct
(
png_ptr
);
if
(
!
png_info_ptr
)
{
png_destroy_read_struct
(
&
png_ptr
,
NULL
,
NULL
);
I_Error
(
"PNG_
Lo
ad: libpng couldn't allocate memory!"
);
I_Error
(
"PNG_
Re
ad: libpng couldn't allocate memory!"
);
}
#ifdef USE_FAR_KEYWORD
...
...
@@ -821,9 +821,8 @@ static png_bytep *PNG_Read(const UINT8 *png, INT32 *w, INT32 *h, INT16 *topoffse
if
(
setjmp
(
png_jmpbuf
(
png_ptr
)))
#endif
{
//CONS_Debug(DBG_RENDER, "libpng load error on %s\n", filename);
png_destroy_read_struct
(
&
png_ptr
,
&
png_info_ptr
,
NULL
);
return
NULL
;
I_Error
(
"PNG_Read: libpng load error!"
)
;
}
#ifdef USE_FAR_KEYWORD
png_memcpy
(
png_jmpbuf
(
png_ptr
),
jmpbuf
,
sizeof
jmp_buf
);
...
...
@@ -1053,17 +1052,13 @@ boolean Picture_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t si
png_ptr
=
png_create_read_struct
(
PNG_LIBPNG_VER_STRING
,
NULL
,
PNG_error
,
PNG_warn
);
if
(
!
png_ptr
)
{
CONS_Debug
(
DBG_RENDER
,
"PNG_Load: Error on initialize libpng
\n
"
);
return
false
;
}
I_Error
(
"Picture_PNGDimensions: Couldn't initialize libpng!"
);
png_info_ptr
=
png_create_info_struct
(
png_ptr
);
if
(
!
png_info_ptr
)
{
CONS_Debug
(
DBG_RENDER
,
"PNG_Load: Error on allocate for libpng
\n
"
);
png_destroy_read_struct
(
&
png_ptr
,
NULL
,
NULL
);
return
false
;
I_Error
(
"Picture_PNGDimensions: libpng couldn't allocate memory!"
)
;
}
#ifdef USE_FAR_KEYWORD
...
...
@@ -1072,9 +1067,8 @@ boolean Picture_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t si
if
(
setjmp
(
png_jmpbuf
(
png_ptr
)))
#endif
{
//CONS_Debug(DBG_RENDER, "libpng load error on %s\n", filename);
png_destroy_read_struct
(
&
png_ptr
,
&
png_info_ptr
,
NULL
);
return
false
;
I_Error
(
"Picture_PNGDimensions: libpng load error!"
)
;
}
#ifdef USE_FAR_KEYWORD
png_memcpy
(
png_jmpbuf
(
png_ptr
),
jmpbuf
,
sizeof
jmp_buf
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment