After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 634314 - pngdec hangs on faulty pngs
pngdec hangs on faulty pngs
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal major
: 0.10.27
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-08 12:47 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2010-12-06 15:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use png_error() (819 bytes, patch)
2010-11-08 12:48 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review
broken png (147 bytes, application/octet-stream)
2010-11-08 12:50 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
  Details

Description Stefan Sauer (gstreamer, gtkdoc dev) 2010-11-08 12:47:58 UTC
Before:

$ GST_DEBUG="*:2,png*:5" gst-launch playbin2 uri=file://$PWD/broken.png
Leitung wird auf PAUSIERT gesetzt ...
0:00:00.094174756  9650  0x854a050 LOG                   pngdec gstpngdec.c:762:gst_pngdec_libpng_init: init libpng structures
Leitung läuft vor …
0:00:00.095452781  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:487:gst_pngdec_task:<pngdec0> read frame
0:00:00.095480648  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8 bytes of data at offset 0
0:00:00.095526394  9650  0x86ef5d8 DEBUG                 pngdec gstpngdec.c:645:gst_pngdec_sink_setcaps:<pngdec0> single picture input
0:00:00.095556495  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8 bytes of data at offset 8
0:00:00.095592463  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 13 bytes of data at offset 16
0:00:00.095618584  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 4 bytes of data at offset 29
0:00:00.095648267  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8 bytes of data at offset 33
0:00:00.095674317  9650  0x86ef5d8 WARN                  pngdec gstpngdec.c:178:user_warning_fn: Incorrect cHRM chunk length
0:00:00.095689473  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.095717619  9650  0x86ef5d8 WARN                  pngdec gstpngdec.c:353:user_read_data:<pngdec0> error: Internal data stream error.
0:00:00.095732914  9650  0x86ef5d8 WARN                  pngdec gstpngdec.c:353:user_read_data:<pngdec0> error: Read 106, needed 8192bytes
FEHLER: Von Element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstPngDec:pngdec0: Internal data stream error.
Zusätzliche Fehlerdiagnoseinformation:
gstpngdec.c(353): user_read_data (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstPngDec:pngdec0:
Read 106, needed 8192bytes
FEHLER: Leitung läuft nicht vor.
Leitung wird auf NULL gesetzt ...
0:00:00.096027644  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason error
0:00:00.096047549  9650  0x86ef5d8 WARN                  pngdec gstpngdec.c:343:user_read_data:<pngdec0> error: Internal data stream error.
0:00:00.096062635  9650  0x86ef5d8 WARN                  pngdec gstpngdec.c:343:user_read_data:<pngdec0> error: stream stopped, reason error
0:00:00.096125282  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.096145117  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.096172635  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.096189327  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.096390051  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.096408698  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.096435587  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.096451860  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.096478959  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.096495232  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.096521632  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.096537835  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.096564235  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.096580368  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.102283398  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.102314198  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.102341995  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.102358687  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.102385297  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.102401779  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.102428459  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.102444801  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
0:00:00.102471062  9650  0x86ef5d8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.102487405  9650  0x86ef5d8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason wrong-state
...
<forever>


After the patch:

$ GST_DEBUG="*:2,png*:5" gst-launch playbin2 uri=file://$PWD/broken.png
Leitung wird auf PAUSIERT gesetzt ...
0:00:00.134171517 17703  0x85ea050 LOG                   pngdec gstpngdec.c:763:gst_pngdec_libpng_init: init libpng structures
Leitung läuft vor …
0:00:00.134962399 17703  0x878f5e8 LOG                   pngdec gstpngdec.c:488:gst_pngdec_task:<pngdec0> read frame
0:00:00.134990406 17703  0x878f5e8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8 bytes of data at offset 0
0:00:00.135032450 17703  0x878f5e8 DEBUG                 pngdec gstpngdec.c:646:gst_pngdec_sink_setcaps:<pngdec0> single picture input
0:00:00.135062203 17703  0x878f5e8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8 bytes of data at offset 8
0:00:00.135098380 17703  0x878f5e8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 13 bytes of data at offset 16
0:00:00.135124222 17703  0x878f5e8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 4 bytes of data at offset 29
0:00:00.135153695 17703  0x878f5e8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8 bytes of data at offset 33
0:00:00.135179047 17703  0x878f5e8 WARN                  pngdec gstpngdec.c:178:user_warning_fn: Incorrect cHRM chunk length
0:00:00.135193784 17703  0x878f5e8 LOG                   pngdec gstpngdec.c:313:user_read_data: reading 8192 bytes of data at offset 41
0:00:00.135221161 17703  0x878f5e8 WARN                  pngdec gstpngdec.c:354:user_read_data:<pngdec0> error: Internal data stream error.
0:00:00.135236247 17703  0x878f5e8 WARN                  pngdec gstpngdec.c:354:user_read_data:<pngdec0> error: Read 106, needed 8192bytes
FEHLER: Von Element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstPngDec:pngdec0: Internal data stream error.
Zusätzliche Fehlerdiagnoseinformation:
gstpngdec.c(354): user_read_data (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstPngDec:pngdec0:
Read 106, needed 8192bytes
FEHLER: Leitung läuft nicht vor.
Leitung wird auf NULL gesetzt ...
0:00:00.135533282 17703  0x878f5e8 INFO                  pngdec gstpngdec.c:336:user_read_data:<pngdec0> pausing task, reason error
0:00:00.135553117 17703  0x878f5e8 WARN                  pngdec gstpngdec.c:343:user_read_data:<pngdec0> error: Internal data stream error.
0:00:00.135567853 17703  0x878f5e8 WARN                  pngdec gstpngdec.c:343:user_read_data:<pngdec0> error: stream stopped, reason error
0:00:00.135617371 17703  0x878f5e8 ERROR                 pngdec gstpngdec.c:172:user_error_fn: Internal data stream error.
libpng error: Internal data stream error.
0:00:00.135645168 17703  0x878f5e8 INFO                  pngdec gstpngdec.c:548:gst_pngdec_task:<pngdec0> pausing task, reason error
0:00:00.135661790 17703  0x878f5e8 WARN                  pngdec gstpngdec.c:555:gst_pngdec_task:<pngdec0> error: Internal data stream error.
0:00:00.135676736 17703  0x878f5e8 WARN                  pngdec gstpngdec.c:555:gst_pngdec_task:<pngdec0> error: stream stopped, reason error
0:00:00.135764387 17703  0x85ea050 LOG                   pngdec gstpngdec.c:725:gst_pngdec_libpng_clear: cleaning up libpng structures
Leitung wird geleert ...
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-11-08 12:48:56 UTC
Created attachment 174054 [details] [review]
use png_error()
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-11-08 12:50:36 UTC
Created attachment 174055 [details]
broken png

(content type intentionally set to octet stream to not test your browsers ability to handle broken pngs).
Comment 3 Mark Nauwelaerts 2010-12-06 15:30:42 UTC
commit a513a7be7548a27a516e7f62468284bf09b1fcc1
Author: Stefan Kost <ensonic@users.sf.net>
Date:   Mon Nov 8 14:47:04 2010 +0200

    pngdec: use png_error() as recommended by libpng docs to signal an error
    
    Without that the element loops endlessly on broekn pngs. Fixes #634314