MRTG Error: gd-png: fatal libpng error: Invalid filter type specified

I recently upgraded my MRTG install from v 2.10.13 to 2.11.1, and while the upgrade went fine, I ran into problems running mrtg:
[bash] /usr/local/mrtg-2/bin/mrtg /etc/mrtg/mrtg.cfg
gd-png: fatal libpng error: Invalid filter type specified
gd-png error: setjmp returns error condition
gd-png: fatal libpng error: Invalid filter type specified
gd-png error: setjmp returns error condition
gd-png: fatal libpng error: Invalid filter type specified
gd-png error: setjmp returns error condition
.....

I did a thorough Google search and never found a good answer or fix, except for a patch to the MRTG source code, which I didn’t find satisfactory. So it turns out that it was a problem with the PNG libraries. The machine was running an old Redhat 7.2, and libpng had previously been installed via RPM, with the libpng files from this RPM residing in /usr/lib. Prior to upgrading MRTG I had installed a newer libpng via source, with the new libpng files residing in /usr/local/lib. So the problem was that I had two different versions of libpng installed in different places on the machine, and this was causing the problems. This was easily fixed by creating symbolic links from the old RPM dir (/usr/lib) to the new manually installed dir (/usr/local/lib)
[bash] cd /usr/lib
[bash] mv libpng.a libpng.a.old
[bash] ln -s /usr/local/lib/libpng.a libpng.a
[bash] ln -s /usr/local/lib/libpng.so.3.1.2.8 libpng.so.3
[bash] ln -s /usr/local/lib/libpng.so.3 libpng.so

Once this library hell was fixed, MRTG went back to operating as expected.