Changeset 1173
- Timestamp:
- 10/23/09 17:32:03 (9 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
CommonUtils.c (modified) (1 diff)
-
CommonUtils.h (modified) (1 diff)
-
FrameBuffer.c (modified) (1 diff)
-
VobSubCodec.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CommonUtils.c
r1139 r1173 442 442 pthread_mutex_unlock(&init_mutex); 443 443 } 444 445 void *fast_realloc_with_padding(void *ptr, unsigned int *size, unsigned int min_size) 446 { 447 void *res = ptr; 448 av_fast_malloc(&res, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE); 449 if (res) memset(res + min_size, 0, FF_INPUT_BUFFER_PADDING_SIZE); 450 return res; 451 } -
trunk/CommonUtils.h
r1139 r1173 66 66 int PerianInitEnter(volatile Boolean *inited); 67 67 void PerianInitExit(int unlock); 68 68 69 void *fast_realloc_with_padding(void *ptr, unsigned int *size, unsigned int min_size); 70 69 71 #define PERIAN_PREF_DOMAIN CFSTR("org.perian.Perian") 70 72 -
trunk/FrameBuffer.c
r1075 r1173 76 76 uint8_t *FFusionCreateEntireDataBuffer(FFusionData *data, uint8_t *buffer, int bufferSize) 77 77 { 78 data->ringBuffer = av_fast_realloc(data->ringBuffer, &(data->ringSize), bufferSize + FF_INPUT_BUFFER_PADDING_SIZE);78 data->ringBuffer = fast_realloc_with_padding(data->ringBuffer, &data->ringSize, bufferSize); 79 79 if (data->ringBuffer) { 80 uint8_t *dataPtr = data->ringBuffer; 81 memcpy(dataPtr, buffer, bufferSize); 82 memset(dataPtr + bufferSize, 0, FF_INPUT_BUFFER_PADDING_SIZE); 80 memcpy(data->ringBuffer, buffer, bufferSize); 83 81 } 84 82 return data->ringBuffer; -
trunk/VobSubCodec.c
r1171 r1173 293 293 // reallocate our buffer to be big enough to store the decompressed packet 294 294 *bufferSize = AV_RB16(glob->codecData); 295 glob->codecData = av_fast_realloc(glob->codecData, &glob->bufferSize, *bufferSize);295 glob->codecData = fast_realloc_with_padding(glob->codecData, &glob->bufferSize, *bufferSize); 296 296 297 297 // then decompress the rest of it … … 317 317 318 318 if (glob->codecData == NULL) { 319 glob->codecData = malloc(myDrp->bufferSize + 2);319 glob->codecData = av_malloc(myDrp->bufferSize + 2); 320 320 glob->bufferSize = myDrp->bufferSize + 2; 321 321 } 322 322 323 323 // make sure we have enough space to store the packet 324 glob->codecData = av_fast_realloc(glob->codecData, &glob->bufferSize, myDrp->bufferSize + 2);324 glob->codecData = fast_realloc_with_padding(glob->codecData, &glob->bufferSize, myDrp->bufferSize + 2); 325 325 326 326 if (glob->compressed) {
