[MPlayer-dev-eng] [PATCH] vd_mtga.c segfault for increment == -1

Michael Lampe Michael.Lampe at iwr.uni-heidelberg.de
Fri Mar 7 19:43:46 CET 2003


Hi,

increment in struct TGAInfo is either 1 or -1, but declaring it unsigned 
turns increment=-1 into increment=65536 ==> segfault in either 
decode_rle_tga or decode_uncompressed_tga.

*** libmpcodecs/vd_mtga.c~      Fri Mar  7 18:24:04 2003
--- libmpcodecs/vd_mtga.c       Fri Mar  7 18:29:14 2003
***************
*** 49,55 ****
       unsigned char   bpp;
       unsigned char   origin; /* 0 = lower left, 1 = upper left */
       unsigned short  start_row;
!     unsigned short  increment;
   } TGAInfo;

   static unsigned int out_fmt = 0;
--- 49,55 ----
       unsigned char   bpp;
       unsigned char   origin; /* 0 = lower left, 1 = upper left */
       unsigned short  start_row;
!              short  increment;
   } TGAInfo;

   static unsigned int out_fmt = 0;

-Michael



More information about the MPlayer-dev-eng mailing list