This commit is contained in:
veejay
2023-09-03 20:46:16 +02:00
parent 98c0a42c0a
commit 2cf134b918
4 changed files with 8 additions and 5 deletions

View File

@@ -82,8 +82,8 @@ static int sock_connect(const char *name, int port) {
vj_sock_t *alloc_sock_t(void) vj_sock_t *alloc_sock_t(void)
{ {
vj_sock_t *s = (vj_sock_t*) malloc(sizeof(vj_sock_t)); vj_sock_t *s = (vj_sock_t*) malloc(sizeof(vj_sock_t));
memset( s, 0, sizeof(vj_sock_t));
if(!s) return NULL; if(!s) return NULL;
memset( s, 0, sizeof(vj_sock_t));
return s; return s;
} }

View File

@@ -105,7 +105,7 @@ static int cache_locate_slot( cache_t *v, long frame_num)
void *init_cache( unsigned int n_slots ) void *init_cache( unsigned int n_slots )
{ {
if(n_slots <= 0) if(n_slots == 0)
return NULL; return NULL;
cache_t *v = (cache_t*) vj_calloc(sizeof(cache_t)); cache_t *v = (cache_t*) vj_calloc(sizeof(cache_t));
v->len = n_slots; v->len = n_slots;

View File

@@ -86,7 +86,10 @@ vj_dv1394 *vj_dv1394_init(void *e, int channel, int quality)
} }
vj_dv1394 *v = (vj_dv1394*)vj_malloc(sizeof(vj_dv1394)); vj_dv1394 *v = (vj_dv1394*)vj_malloc(sizeof(vj_dv1394));
if(!v) {
return NULL;
}
}
v->map_size = (el->video_norm == 'p' ? DV_PAL_SIZE: DV_NTSC_SIZE); v->map_size = (el->video_norm == 'p' ? DV_PAL_SIZE: DV_NTSC_SIZE);
v->handle = -1; v->handle = -1;
v->width = el->video_width; v->width = el->video_width;

View File

@@ -316,9 +316,9 @@ static void osc_add_client(void *context, int arglen, const void *vargs, OSCTime
return; return;
} }
char port[6]; char port[6];
snprintf( port, sizeof(port-1), "%d", args[0] ); snprintf( port, sizeof(port), "%d", args[0] );
char name[1024]; char name[1024];
snprintf(name, sizeof(name)-1, "%s:%s", str,port ); snprintf(name, sizeof(name), "%s:%s", str,port );
char *cmd = "/status"; char *cmd = "/status";
char *nptr = name; char *nptr = name;
if( osc_has_connection( name ) ) { if( osc_has_connection( name ) ) {