MCPcopy Create free account
hub / github.com/coreboot/coreboot / LzmaDecodeProperties

Function LzmaDecodeProperties

src/lib/lzmadecode.c:179–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177#endif
178
179int LzmaDecodeProperties(CLzmaProperties *propsRes,
180 const unsigned char *propsData, int size)
181{
182 unsigned char prop0;
183 if (size < LZMA_PROPERTIES_SIZE)
184 return LZMA_RESULT_DATA_ERROR;
185 prop0 = propsData[0];
186 if (prop0 >= (9 * 5 * 5))
187 return LZMA_RESULT_DATA_ERROR;
188 {
189 for (propsRes->pb = 0; prop0 >= (9 * 5);
190 propsRes->pb++, prop0 -= (9 * 5))
191 ;
192 for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9)
193 ;
194 propsRes->lc = prop0;
195 /*
196 * unsigned char remainder = (unsigned char)(prop0 / 9);
197 * propsRes->lc = prop0 % 9;
198 * propsRes->pb = remainder / 5;
199 * propsRes->lp = remainder % 5;
200 */
201 }
202
203 return LZMA_RESULT_OK;
204}
205
206#define kLzmaStreamWasFinishedId (-1)
207

Callers 1

ulzmanFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected