Issue 505 in webp: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max

109 views
Skip to first unread message

froms… via monorail

unread,
Feb 10, 2021, 3:31:58 AM2/10/21
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 505 by froms...@gmail.com: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max
https://bugs.chromium.org/p/webp/issues/detail?id=505

What steps will reproduce the problem?
1.Trying to compile libwebp without shared libs under Ubuntu 16.04
2.Steps taken
----------------------------------------------------------------------
# lsb_release -d
Description: Ubuntu 16.04.7 LTS
# wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.0.tar.gz
# ac_cv_path_LIBPNG_CONFIG='/usr/bin/libpng12-config --static' LDFLAGS="-static -static-libgcc" BUILD_IMG2WEBP_TRUE=yes enable_libwebpdemux=yes enable_libwebpmux=yes ./configure --disable-shared
[...]
configure:
WebP Configuration Summary
--------------------------

Shared libraries: no
Static libraries: yes
Threading support: yes
libwebp: yes
libwebpdecoder: no
libwebpdemux: yes
libwebpmux: yes
libwebpextras: no

Tools:
cwebp : yes
Input format support
====================
JPEG : yes
PNG : yes
TIFF : yes
WIC : no
dwebp : yes
Output format support
=====================
PNG : yes
WIC : no
GIF support : yes
anim_diff : yes
gif2webp : yes
img2webp : yes
webpmux : yes
vwebp : no
webpinfo : yes
SDL support : no
vwebp_sdl : no
----------------------------------------------------------------------
# make
[...]
Making all in imageio
make[1]: Entering directory '/root/libwebp-1.2.0/imageio'
CC imageio_util.lo
CCLD libimageio_util.la
CC libimagedec_la-image_dec.lo
CC libimagedec_la-jpegdec.lo
CC libimagedec_la-metadata.lo
CC libimagedec_la-pngdec.lo
pngdec.c: In function ‘ReadPNG’:
pngdec.c:264:19: warning: implicit declaration of function ‘png_get_chunk_malloc_max’ [-Wimplicit-function-declaration]
if (data_size > png_get_chunk_malloc_max(png) && data_size < (1u << 24)) {
^
pngdec.c:264:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (data_size > png_get_chunk_malloc_max(png) && data_size < (1u << 24)) {
^
pngdec.c:265:5: warning: implicit declaration of function ‘png_set_chunk_malloc_max’ [-Wimplicit-function-declaration]
png_set_chunk_malloc_max(png, data_size);
^
CC libimagedec_la-pnmdec.lo
CC libimagedec_la-tiffdec.lo
CC libimagedec_la-webpdec.lo
CC libimagedec_la-wicdec.lo
CCLD libimagedec.la
CC libimageenc_la-image_enc.lo
CCLD libimageenc.la
make[1]: Leaving directory '/root/libwebp-1.2.0/imageio'
Making all in man
make[1]: Entering directory '/root/libwebp-1.2.0/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/root/libwebp-1.2.0/man'
Making all in examples
make[1]: Entering directory '/root/libwebp-1.2.0/examples'
CC dwebp-dwebp.o
CC example_util.lo
CCLD libexample_util.la
CCLD dwebp
CC cwebp-cwebp.o
CCLD cwebp
../imageio/.libs/libimagedec.a(libimagedec_la-pngdec.o): In function `ReadPNG':
/root/libwebp-1.2.0/imageio/pngdec.c:264: undefined reference to `png_get_chunk_malloc_max'
/root/libwebp-1.2.0/imageio/pngdec.c:265: undefined reference to `png_set_chunk_malloc_max'
collect2: error: ld returned 1 exit status
Makefile:572: recipe for target 'cwebp' failed
make[1]: *** [cwebp] Error 1
make[1]: Leaving directory '/root/libwebp-1.2.0/examples'
Makefile:423: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
----------------------------------------------------------------------
Paths seem to be correct:

~/libwebp-1.2.0/imageio# grep -i png Makefile
libimagedec_la-pngdec.lo libimagedec_la-pnmdec.lo \
./$(DEPDIR)/libimagedec_la-pngdec.Plo \
LIBPNG_CONFIG = /usr/bin/libpng12-config --static
PNG_INCLUDES = -I/usr/include/libpng12 -DWEBP_HAVE_PNG
PNG_LIBS = -lpng12 -lz -lm
metadata.c metadata.h pngdec.c pngdec.h pnmdec.c pnmdec.h \
libimagedec_la_CPPFLAGS = $(JPEG_INCLUDES) $(PNG_INCLUDES) \
libimageenc_la_CPPFLAGS = $(JPEG_INCLUDES) $(PNG_INCLUDES) \
include ./$(DEPDIR)/libimagedec_la-pngdec.Plo # am--include-marker
libimagedec_la-pngdec.lo: pngdec.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libimagedec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libimagedec_la-pngdec.lo -MD -MP -MF $(DEPDIR)/libimagedec_la-pngdec.Tpo -c -o libimagedec_la-pngdec.lo `test -f 'pngdec.c' || echo '$(srcdir)/'`pngdec.c
$(AM_V_at)$(am__mv) $(DEPDIR)/libimagedec_la-pngdec.Tpo $(DEPDIR)/libimagedec_la-pngdec.Plo
# $(AM_V_CC)source='pngdec.c' object='libimagedec_la-pngdec.lo' libtool=yes \
# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libimagedec_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libimagedec_la-pngdec.lo `test -f 'pngdec.c' || echo '$(srcdir)/'`pngdec.c
-rm -f ./$(DEPDIR)/libimagedec_la-pngdec.Plo
-rm -f ./$(DEPDIR)/libimagedec_la-pngdec.Plo
----------------------------------------------------------------------


What version of the product are you using? On what operating system?
1.2.0 with Ubuntu 16.04

Please provide any additional information below.
Last version I compiled successfully was 1.0.3 on the same system.

Any hints why PNG libs are not found at this compile step?

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

jz… via monorail

unread,
Feb 10, 2021, 4:37:56 PM2/10/21
to webp-d...@webmproject.org
Updates:
Owner: jz...@google.com
Status: Started

Comment #1 on issue 505 by jz...@google.com: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max
https://bugs.chromium.org/p/webp/issues/detail?id=505#c1

Thanks for the report. Those functions were added in 1.4.1, we missed adding a version check.

bugdroid via monorail

unread,
Feb 10, 2021, 7:44:42 PM2/10/21
to webp-d...@webmproject.org

Comment #2 on issue 505 by bugdroid: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max
https://bugs.chromium.org/p/webp/issues/detail?id=505#c2

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libwebp/+/2690782292a7ffa4b4405aec1818253a64522baa

commit 2690782292a7ffa4b4405aec1818253a64522baa
Author: James Zern <jz...@google.com>
Date: Wed Feb 10 21:41:54 2021

pngdec: check version before using png_get_chunk_malloc_max

png_get_chunk_malloc_max / png_set_chunk_malloc_max were added in 1.4.1.

Bug: webp:505, webp:497
Change-Id: Id4e0643a7734563fec7779f7943ec760da8d276d

[modify] https://crrev.com/2690782292a7ffa4b4405aec1818253a64522baa/imageio/pngdec.c

bugdroid via monorail

unread,
Feb 10, 2021, 9:54:25 PM2/10/21
to webp-d...@webmproject.org
Updates:
Labels: merge-merged-1.2.0

Comment #3 on issue 505 by bugdroid: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max
https://bugs.chromium.org/p/webp/issues/detail?id=505#c3


The following revision refers to this bug:
https://chromium.googlesource.com/webm/libwebp/+/113968ca47b1d1affbfe88472364b15699e239d6

commit 113968ca47b1d1affbfe88472364b15699e239d6
Author: James Zern <jz...@google.com>
Date: Thu Feb 11 00:58:41 2021


pngdec: check version before using png_get_chunk_malloc_max

png_get_chunk_malloc_max / png_set_chunk_malloc_max were added in 1.4.1.

Bug: webp:505, webp:497
Change-Id: Id4e0643a7734563fec7779f7943ec760da8d276d
(cherry picked from commit 2690782292a7ffa4b4405aec1818253a64522baa)

[modify] https://crrev.com/113968ca47b1d1affbfe88472364b15699e239d6/imageio/pngdec.c

jz… via monorail

unread,
Feb 10, 2021, 9:57:57 PM2/10/21
to webp-d...@webmproject.org
Updates:
Labels: v1.2.1
Status: Fixed

Comment #4 on issue 505 by jz...@google.com: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max
https://bugs.chromium.org/p/webp/issues/detail?id=505#c4

Thanks again for the report. This should be resolved on both the master and 1.2.0 branch. It will be picked up in the next release.

froms… via monorail

unread,
Feb 11, 2021, 1:08:08 AM2/11/21
to webp-d...@webmproject.org

Comment #5 on issue 505 by froms...@gmail.com: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max
https://bugs.chromium.org/p/webp/issues/detail?id=505#c5

That was fast, thanks a lot for the effort!

jz… via monorail

unread,
Mar 11, 2021, 10:27:11 PM3/11/21
to webp-d...@webmproject.org

Comment #6 on issue 505 by jz...@chromium.org: Compiling pngdec.c failes with undefined reference to png_get_chunk_malloc_max
https://bugs.chromium.org/p/webp/issues/detail?id=505#c6

Issue 511 has been merged into this issue.
Reply all
Reply to author
Forward
0 new messages