Menu

#3 Bug in TGAWriteImage

v1.0_(example)
open
nobody
5
2017-05-05
2007-12-10
No

I get an error when I run encode.c with a true color TGA. Somehow TGAWriteImage calls TGAWriteColorMap which calls TGAWrite(tga, buf, n, 1) with n=0 which returns 0 which is considered an error. I'm using libtga-1.0.1.

Discussion

  • Ricardo Dalcorsso Fodra

    Image that encode.c doesn't handle.

     
  • Ricardo Dalcorsso Fodra

    Logged In: YES
    user_id=778134
    Originator: YES

    Apparently the problem is in TGAReadImage. It is not setting data->cmap to NULL If the TGA is not color-mapped. Also TGAWriteImage checks for data->cmap, not TGA_IS_MAPPED.

     
  • Maarten

    Maarten - 2017-05-05

    Hey,
    I forked this project on GitHub and fixed some bugs on the way.
    My fork can run length encode (and decode) the attached file just fine.
    The fork is at https://github.com/madebr/libtga.

     

Log in to post a comment.