<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>At gdalrasterize.cpp:349 there is a call to Transformer but the
      TransformArg is NULL, which leads to segfault. Above the call
      there is a comment:<br>
    </p>
    <p>// TODO: We need to add all appropriate error checking at some
      point.</p>
    Obviously not all error checking is not done.<br>
    <br>
    I also noticed that in Perl code there is some additional ease of
    use added to the user - she can give to the Rasterize method simply
    a file name, which implicitly assumes that the user has given
    options that cause the file to be created, and if not the result is
    a segfault. The same happens in gdal_rasterize:<br>
    <br>
    gdal_rasterize -burn 17 -l features 20.gml test.tiff<br>
    <br>
    results in segfault<br>
    <br>
    Ari<br>
    <br>
    <div class="moz-cite-prefix">30.11.2016, 16:51, Kurt Schwehr
      kirjoitti:<br>
    </div>
    <blockquote
cite="mid:CACmBxyu2nEdkfQeCcJzsBzKQg-yQn-m-v-SCAFD7ZbPmTVp60A@mail.gmail.com"
      type="cite">
      <div dir="ltr">Bugger.  That segfault should be turned into a
        clean failure.  I looked a bunch and wasn't sure how to safely
        do that.
        <div><br>
        </div>
        <div>This didn't do the job...  the segfault happens somewhere
          after this.</div>
        <div><br>
        </div>
        <div>
          <div>svn diff gdalrasterize.cpp </div>
          <div>Index: gdalrasterize.cpp</div>
          <div>===================================================================</div>
          <div>--- gdalrasterize.cpp<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>(revision
            36569)</div>
          <div>+++ gdalrasterize.cpp<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>(working
            copy)</div>
          <div>@@ -635,6 +635,10 @@</div>
          <div>         pfnTransformer = GDALGenImgProjTransform;</div>
          <div>     }</div>
          <div> </div>
          <div>+    if( pfnTransformer == NULL )</div>
          <div>+    {</div>
          <div>+        return CE_Failure;</div>
          <div>+    }</div>
          <div> /*
            --------------------------------------------------------------------
            */</div>
          <div> /*      Establish a chunksize to operate on.  The larger
            the chunk      */</div>
          <div> /*      size the less times we need to make a pass
            through all the      */</div>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Nov 30, 2016 at 5:03 AM, Tim
          Waters <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:chippy2005@gmail.com" target="_blank">chippy2005@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><span
              class="">On 29 November 2016 at 22:36, Even Rouault <<a
                moz-do-not-send="true"
                href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>>
              wrote:<br>
              > Tim,<br>
              ><br>
              > Could you provide the dataset to reproduce as well ?
              And it seems your<br>
              > Python script is not valid since the 'sr' variable
              passed in<br>
              > rast_ogr_ds.CreateLayer( 'poly', srs=sr ) is not
              defined.<br>
              <br>
            </span>Hello,<br>
            <br>
            Apologies for the script not working! I sanitized paths etc
            and broke<br>
            it, doh - I hope this email helps.<br>
            <br>
            I've put all the correct files in a new GitHub repository:<br>
            <a moz-do-not-send="true"
              href="https://github.com/timwaters/gdal_rasterize_error"
              rel="noreferrer" target="_blank">https://github.com/timwaters/<wbr>gdal_rasterize_error</a><br>
            including an expected screenshot of the inverted burn which
            was<br>
            generated from my box running 1.10.1<br>
            <br>
            (Note that it appears that in 1.10.1 the raster does
            successfully get<br>
            burnt, no error or segfault is shown, but the script will
            output<br>
            "fail")<br>
            <br>
            I've looked at whether -to SRC_METHOD=NO_GEOTRANSFORM is
            available for<br>
            the gdal_rasterize utility but I don't think it is?<br>
            <br>
            Best regards and thanks in advance,<br>
            <div class="HOEnZb">
              <div class="h5"><br>
                Tim<br>
                ______________________________<wbr>_________________<br>
                gdal-dev mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"
                  rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a></div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">--
          <div><a moz-do-not-send="true" href="http://schwehr.org"
              target="_blank">http://schwehr.org</a></div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>