Improve some debugging to try to diagnose recent segfault report

This commit is contained in:
Isaac Connor 2019-08-10 14:46:05 -04:00
parent 0cdb43e165
commit 5b62c91cc2
3 changed files with 9 additions and 9 deletions

View File

@ -953,7 +953,8 @@ int FfmpegCamera::CaptureAndRecord(
continue;
}
if ( error_count > 0 ) error_count--;
zm_dump_video_frame(mRawFrame);
Debug(3, "Decoded video packet at frame %d", frameCount);
zm_dump_video_frame(mRawFrame, "raw frame from decoder");
#if HAVE_LIBAVUTIL_HWCONTEXT_H
#if LIBAVCODEC_VERSION_CHECK(57, 89, 0, 89, 0)
if (

View File

@ -497,8 +497,8 @@ uint8_t* Image::WriteBuffer(const unsigned int p_width, const unsigned int p_hei
return NULL;
}
if ( !p_height || !p_width ) {
Error("WriteBuffer called with invalid width or height: %d %d",p_width,p_height);
if ( ! ( p_height > 0 && p_width > 0 ) ) {
Error("WriteBuffer called with invalid width or height: %d %d", p_width, p_height);
return NULL;
}
@ -525,11 +525,10 @@ uint8_t* Image::WriteBuffer(const unsigned int p_width, const unsigned int p_hei
colours = p_colours;
subpixelorder = p_subpixelorder;
pixels = height*width;
size = newsize;
}
size = newsize;
} // end if need to re-alloc buffer
return buffer;
}
/* Assign an existing buffer to the image instead of copying from a source buffer. The goal is to reduce the amount of memory copying and increase efficiency and buffer reusing. */

View File

@ -56,9 +56,9 @@ extern imgbufcpy_fptr_t fptr_imgbufcpy;
/* Should be called from Image class functions */
inline static uint8_t* AllocBuffer(size_t p_bufsize) {
uint8_t* buffer = (uint8_t*)zm_mallocaligned(64,p_bufsize);
uint8_t* buffer = (uint8_t*)zm_mallocaligned(64, p_bufsize);
if ( buffer == NULL )
Fatal("Memory allocation failed: %s",strerror(errno));
Fatal("Memory allocation failed: %s", strerror(errno));
return buffer;
}
@ -75,7 +75,7 @@ inline static void DumpBuffer(uint8_t* buffer, int buffertype) {
av_free(buffer);
*/
} else {
Error( "Unknown buffer type in DumpBuffer(%d)", buffertype );
Error("Unknown buffer type in DumpBuffer(%d)", buffertype);
}
}
}