~ubuntu-branches/ubuntu/jaunty/devil/jaunty

« back to all changes in this revision

Viewing changes to src-IL/src/il_raw.c

  • Committer: Bazaar Package Importer
  • Author(s): Bradley Smith
  • Date: 2009-01-17 15:01:18 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090117150118-4bwb6nmvbz4srsjl
Tags: 1.7.5-4
Actually fix CVE-2008-5262. Closes: #512122.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#ifndef IL_NO_RAW
16
16
 
17
17
 
18
 
ILboolean iLoadRawInternal(ILvoid);
19
 
ILboolean iSaveRawInternal(ILvoid);
 
18
ILboolean iLoadRawInternal(void);
 
19
ILboolean iSaveRawInternal(void);
20
20
 
21
21
 
22
22
//! Reads a raw file
23
 
ILboolean ilLoadRaw(const ILstring FileName)
 
23
ILboolean ilLoadRaw(ILconst_string FileName)
24
24
{
25
25
        ILHANDLE        RawFile;
26
26
        ILboolean       bRaw = IL_FALSE;
60
60
 
61
61
 
62
62
//! Reads from a raw memory "lump"
63
 
ILboolean ilLoadRawL(const ILvoid *Lump, ILuint Size)
 
63
ILboolean ilLoadRawL(const void *Lump, ILuint Size)
64
64
{
65
65
        iSetInputLump(Lump, Size);
66
66
        return iLoadRawInternal();
74
74
                ilSetError(IL_ILLEGAL_OPERATION);
75
75
                return IL_FALSE;
76
76
        }
77
 
 
78
 
        iCurImage->Width = GetLittleUInt();
79
 
        iCurImage->Height = GetLittleUInt();
80
 
        iCurImage->Depth = GetLittleUInt();
81
 
        iCurImage->Bpp = igetc();
 
77
 
 
78
 
 
79
        iCurImage->Width = GetLittleUInt();
 
80
 
 
81
        iCurImage->Height = GetLittleUInt();
 
82
 
 
83
        iCurImage->Depth = GetLittleUInt();
 
84
 
 
85
        iCurImage->Bpp = (ILubyte)igetc();
 
86
 
82
87
        if (iread(&iCurImage->Bpc, 1, 1) != 1)
83
88
                return IL_FALSE;
84
89
 
112
117
 
113
118
 
114
119
//! Writes a Raw file
115
 
ILboolean ilSaveRaw(const ILstring FileName)
 
120
ILboolean ilSaveRaw(ILconst_string FileName)
116
121
{
117
122
        ILHANDLE        RawFile;
118
123
        ILboolean       bRaw = IL_FALSE;
146
151
 
147
152
 
148
153
//! Writes raw data to a memory "lump"
149
 
ILboolean ilSaveRawL(ILvoid *Lump, ILuint Size)
 
154
ILboolean ilSaveRawL(void *Lump, ILuint Size)
150
155
{
151
156
        iSetOutputLump(Lump, Size);
152
157
        return iSaveRawInternal();