Dynamically allocate the RTSP response buffer

This commit is contained in:
Cameron Gutman
2020-04-29 19:58:50 -07:00
parent 247b1fe0e3
commit 7d0458a16b
3 changed files with 47 additions and 24 deletions

View File

@@ -63,6 +63,14 @@ int extractVersionQuadFromString(const char* string, int* quad) {
return 0;
}
void* extendBuffer(void* ptr, size_t newSize) {
void* newBuf = realloc(ptr, newSize);
if (newBuf == NULL && ptr != NULL) {
free(ptr);
}
return newBuf;
}
int isReferenceFrameInvalidationEnabled(void) {
LC_ASSERT(NegotiatedVideoFormat != 0);
return ((NegotiatedVideoFormat & VIDEO_FORMAT_MASK_H264) && (VideoCallbacks.capabilities & CAPABILITY_REFERENCE_FRAME_INVALIDATION_AVC)) ||