Mercurial > libavformat.hg
comparison asfcrypt.c @ 6400:6928d93146e6 libavformat
asfcrypt: fix unaligned read in ff_asfcrypt_dec()
author | mru |
---|---|
date | Mon, 23 Aug 2010 15:38:57 +0000 |
parents | e630da0f5861 |
children | 4c2f01a5f69f |
comparison
equal
deleted
inserted
replaced
6399:dda201b8a6f6 | 6400:6928d93146e6 |
---|---|
154 memset(rc4buff, 0, sizeof(rc4buff)); | 154 memset(rc4buff, 0, sizeof(rc4buff)); |
155 av_rc4_init(&rc4, key, 12 * 8, 1); | 155 av_rc4_init(&rc4, key, 12 * 8, 1); |
156 av_rc4_crypt(&rc4, (uint8_t *)rc4buff, NULL, sizeof(rc4buff), NULL, 1); | 156 av_rc4_crypt(&rc4, (uint8_t *)rc4buff, NULL, sizeof(rc4buff), NULL, 1); |
157 multiswap_init((uint8_t *)rc4buff, ms_keys); | 157 multiswap_init((uint8_t *)rc4buff, ms_keys); |
158 | 158 |
159 packetkey = qwords[num_qwords - 1]; | 159 packetkey = AV_RN64(&qwords[num_qwords - 1]); |
160 packetkey ^= rc4buff[7]; | 160 packetkey ^= rc4buff[7]; |
161 av_des_init(&des, key + 12, 64, 1); | 161 av_des_init(&des, key + 12, 64, 1); |
162 av_des_crypt(&des, (uint8_t *)&packetkey, (uint8_t *)&packetkey, 1, NULL, 1); | 162 av_des_crypt(&des, (uint8_t *)&packetkey, (uint8_t *)&packetkey, 1, NULL, 1); |
163 packetkey ^= rc4buff[6]; | 163 packetkey ^= rc4buff[6]; |
164 | 164 |