Changeset b3cb03feaa065b38f2b05219dc38fb78bd3d68cf
- Timestamp:
- 05/10/08 20:01:11
(4 months ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1210442471 +0200
- git-parent:
[261fd89df68f7e4e1a5926c365d060033a5ec30a]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1210442021 +0200
- Message:
Don't override original pointer when realloc fails.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r261fd89 |
rb3cb03f |
|
| 2072 | 2072 | if( rtmp_body->length_body + length > rtmp_body->length_buffer ) |
|---|
| 2073 | 2073 | { |
|---|
| | 2074 | uint8_t *tmp; |
|---|
| 2074 | 2075 | rtmp_body->length_buffer = rtmp_body->length_body + length; |
|---|
| 2075 | | rtmp_body->body = (uint8_t *) realloc( rtmp_body->body, rtmp_body->length_buffer * sizeof( uint8_t ) ); |
|---|
| | 2076 | tmp = realloc( rtmp_body->body, |
|---|
| | 2077 | rtmp_body->length_buffer * sizeof( uint8_t ) ); |
|---|
| | 2078 | if( !tmp ) return; |
|---|
| | 2079 | rtmp_body->body = tmp; |
|---|
| 2076 | 2080 | } |
|---|
| 2077 | 2081 | |
|---|
| … | … | |
| 2321 | 2325 | { |
|---|
| 2322 | 2326 | uint32_t length_tag, timestamp; |
|---|
| 2323 | | |
|---|
| 2324 | | rtmp_packet->body->body = (uint8_t *) realloc( rtmp_packet->body->body, |
|---|
| 2325 | | rtmp_packet->body->length_body + FLV_TAG_PREVIOUS_TAG_SIZE + FLV_TAG_SIZE ); |
|---|
| | 2327 | uint8_t *tmp; |
|---|
| | 2328 | |
|---|
| | 2329 | tmp = (uint8_t *) realloc( rtmp_packet->body->body, |
|---|
| | 2330 | rtmp_packet->body->length_body + |
|---|
| | 2331 | FLV_TAG_PREVIOUS_TAG_SIZE + FLV_TAG_SIZE ); |
|---|
| | 2332 | if( !tmp ) return; |
|---|
| | 2333 | rtmp_packet->body->body = tmp; |
|---|
| 2326 | 2334 | memmove( rtmp_packet->body->body + FLV_TAG_PREVIOUS_TAG_SIZE + FLV_TAG_SIZE, |
|---|
| 2327 | | rtmp_packet->body->body, rtmp_packet->body->length_body ); |
|---|
| | 2335 | rtmp_packet->body->body, rtmp_packet->body->length_body ); |
|---|
| 2328 | 2336 | |
|---|
| 2329 | 2337 | /* Insert tag */ |
|---|