Changeset 133 for smplayer/vendor/current/zlib/inflate.c
- Timestamp:
- Oct 24, 2012, 7:56:20 PM (13 years ago)
- Location:
- smplayer/vendor/current/zlib
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/zlib/inflate.c
r121 r133 1 1 /* inflate.c -- zlib decompression 2 * Copyright (C) 1995-201 1Mark Adler2 * Copyright (C) 1995-2012 Mark Adler 3 3 * For conditions of distribution and use, see copyright notice in zlib.h 4 4 */ … … 520 520 } while (0) 521 521 522 /* Reverse the bytes in a 32-bit value */523 #define REVERSE(q) \524 ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \525 (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))526 527 522 /* 528 523 inflate() uses a state machine to process as much input data and generate as … … 818 813 case DICTID: 819 814 NEEDBITS(32); 820 strm->adler = state->check = REVERSE(hold);815 strm->adler = state->check = ZSWAP32(hold); 821 816 INITBITS(); 822 817 state->mode = DICT; … … 1190 1185 state->flags ? hold : 1191 1186 #endif 1192 REVERSE(hold)) != state->check) {1187 ZSWAP32(hold)) != state->check) { 1193 1188 strm->msg = (char *)"incorrect data check"; 1194 1189 state->mode = BAD; … … 1276 1271 { 1277 1272 struct inflate_state FAR *state; 1278 unsigned long id;1273 unsigned long dictid; 1279 1274 unsigned char *next; 1280 1275 unsigned avail; … … 1287 1282 return Z_STREAM_ERROR; 1288 1283 1289 /* check for correct dictionary id */1284 /* check for correct dictionary identifier */ 1290 1285 if (state->mode == DICT) { 1291 id = adler32(0L, Z_NULL, 0);1292 id = adler32(id, dictionary, dictLength);1293 if ( id != state->check)1286 dictid = adler32(0L, Z_NULL, 0); 1287 dictid = adler32(dictid, dictionary, dictLength); 1288 if (dictid != state->check) 1294 1289 return Z_DATA_ERROR; 1295 1290 }
Note:
See TracChangeset
for help on using the changeset viewer.