comparison wmadec.c @ 819:ae89deb3a97d libavcodec

* avoid negative numbers as well
author kabi
date Thu, 31 Oct 2002 20:22:30 +0000
parents 15ec5cb57695
children 6e6773512288
comparison
equal deleted inserted replaced
818:15ec5cb57695 819:ae89deb3a97d
1280 /* we copy the end of the frame in the last frame buffer */ 1280 /* we copy the end of the frame in the last frame buffer */
1281 pos = get_bits_count(&s->gb) + ((bit_offset + 4 + 4 + s->byte_offset_bits + 3) & ~7); 1281 pos = get_bits_count(&s->gb) + ((bit_offset + 4 + 4 + s->byte_offset_bits + 3) & ~7);
1282 s->last_bitoffset = pos & 7; 1282 s->last_bitoffset = pos & 7;
1283 pos >>= 3; 1283 pos >>= 3;
1284 len = buf_size - pos; 1284 len = buf_size - pos;
1285 if (len > MAX_CODED_SUPERFRAME_SIZE) { 1285 if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) {
1286 return -1; 1286 return -1;
1287 } 1287 }
1288 s->last_superframe_len = len; 1288 s->last_superframe_len = len;
1289 memcpy(s->last_superframe, buf + pos, len); 1289 memcpy(s->last_superframe, buf + pos, len);
1290 } else { 1290 } else {