[libpng16] Avoid dereferencing NULL pointer possibly returned from
png_create_write_struct() (Andrew Church).
This commit is contained in:
parent
61946e0f56
commit
56d6bc2e88
6
ANNOUNCE
6
ANNOUNCE
@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.6.3beta03 - April 27, 2013
|
||||
Libpng 1.6.3beta03 - April 29, 2013
|
||||
|
||||
This is not intended to be a public release. It will be replaced
|
||||
within a few weeks by a public version or by another test version.
|
||||
@ -35,9 +35,11 @@ Version 1.6.3beta02 [April 26, 2013]
|
||||
Test for 'arm*' not just 'arm' in the host_cpu configure variable.
|
||||
Rebuilt the configure scripts.
|
||||
|
||||
Version 1.6.3beta03 [April 27, 2013]
|
||||
Version 1.6.3beta03 [April 29, 2013]
|
||||
Expanded manual paragraph about writing private chunks, particularly
|
||||
the need to call png_set_keep_unknown_chunks() when writing them.
|
||||
Avoid dereferencing NULL pointer possibly returned from
|
||||
png_create_write_struct() (Andrew Church).
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
4
CHANGES
4
CHANGES
@ -4517,9 +4517,11 @@ Version 1.6.3beta02 [April 26, 2013]
|
||||
Test for 'arm*' not just 'arm' in the host_cpu configure variable.
|
||||
Rebuilt the configure scripts.
|
||||
|
||||
Version 1.6.3beta03 [April 27, 2013]
|
||||
Version 1.6.3beta03 [April 29, 2013]
|
||||
Expanded manual paragraph about writing private chunks, particularly
|
||||
the need to call png_set_keep_unknown_chunks() when writing them.
|
||||
Avoid dereferencing NULL pointer possibly returned from
|
||||
png_create_write_struct() (Andrew Church).
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
17
pngwrite.c
17
pngwrite.c
@ -494,15 +494,16 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
|
||||
error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
/* Set the zlib control values to defaults; they can be overridden by the
|
||||
* application after the struct has been created.
|
||||
*/
|
||||
png_ptr->zbuffer_size = PNG_ZBUF_SIZE;
|
||||
|
||||
/* The 'zlib_strategy' setting is irrelevant because png_default_claim in
|
||||
* pngwutil.c defaults it according to whether or not filters will be used,
|
||||
* and ignores this setting.
|
||||
* pngwutil.c defaults it according to whether or not filters will be
|
||||
* used, and ignores this setting.
|
||||
*/
|
||||
png_ptr->zlib_strategy = PNG_Z_DEFAULT_STRATEGY;
|
||||
png_ptr->zlib_level = PNG_Z_DEFAULT_COMPRESSION;
|
||||
@ -518,10 +519,10 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_ptr->zlib_text_method = 8;
|
||||
#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
|
||||
|
||||
/* This is a highly dubious configuration option; by default it is off, but
|
||||
* it may be appropriate for private builds that are testing extensions not
|
||||
* conformant to the current specification, or of applications that must not
|
||||
* fail to write at all costs!
|
||||
/* This is a highly dubious configuration option; by default it is off,
|
||||
* but it may be appropriate for private builds that are testing
|
||||
* extensions not conformant to the current specification, or of
|
||||
* applications that must not fail to write at all costs!
|
||||
*/
|
||||
#ifdef PNG_BENIGN_WRITE_ERRORS_SUPPORTED
|
||||
png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
|
||||
@ -537,8 +538,6 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN;
|
||||
#endif
|
||||
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
/* TODO: delay this, it can be done in png_init_io() (if the app doesn't
|
||||
* do it itself) avoiding setting the default function if it is not
|
||||
* required.
|
||||
|
Loading…
Reference in New Issue
Block a user