Implemented a fix provided by 6x9, ensures that zero or small
camera callback buffer lengths are handled correctly
Fix for issue 365
#include <unistd.h>
#include <errno.h>
-#define VERSION_STRING "v1.3.5"
+#define VERSION_STRING "v1.3.6"
#include "bcm_host.h"
#include "interface/vcos/vcos.h"
int bytes_to_write = buffer->length;
if (pData->pstate->onlyLuma)
- bytes_to_write = port->format->es->video.width * port->format->es->video.height;
+ bytes_to_write = vcos_min(buffer->length, port->format->es->video.width * port->format->es->video.height);
if (bytes_to_write && pData->file_handle)
{
#include <memory.h>
#include <sysexits.h>
-#define VERSION_STRING "v1.3.12"
+#define VERSION_STRING "v1.3.13"
#include "bcm_host.h"
#include "interface/vcos/vcos.h"
int bytes_written = 0;
int bytes_to_write = buffer->length;
- if (buffer->length && pData->pstate->onlyLuma)
- bytes_to_write = port->format->es->video.width * port->format->es->video.height;
-
+ if (pData->pstate->onlyLuma)
+ bytes_to_write = vcos_min(buffer->length, port->format->es->video.width * port->format->es->video.height);
vcos_assert(pData->file_handle);