summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-04-29 15:50:39 +0200
committerWim Taymans <wtaymans@redhat.com>2019-09-12 16:37:02 +0200
commit445927bd347fcb1173f309301bf8664287681a90 (patch)
tree78cedf414b6087ae86da91b219581105799ebe5a
parent060fe40de8cf92420c4bc19e8a78d0cb0b92ac68 (diff)
fix small errors detected by coverity
-rw-r--r--src/video/SDL_surface.c2
-rw-r--r--src/video/fbcon/SDL_fbevents.c2
-rw-r--r--src/video/fbcon/SDL_fbmatrox.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
index 0f3ad12c4b..0386cb3fbe 100644
--- a/src/video/SDL_surface.c
+++ b/src/video/SDL_surface.c
@@ -116,6 +116,7 @@ SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
surface->locked = 0;
surface->map = NULL;
surface->unused1 = 0;
+ surface->refcount = 1;
SDL_SetClipRect(surface, NULL);
SDL_FormatChanged(surface);
@@ -142,7 +143,6 @@ SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
}
/* The surface is ready to go */
- surface->refcount = 1;
#ifdef CHECK_LEAKS
++surfaces_allocated;
#endif
diff --git a/src/video/fbcon/SDL_fbevents.c b/src/video/fbcon/SDL_fbevents.c
index 5e369a4a89..dd7413df9a 100644
--- a/src/video/fbcon/SDL_fbevents.c
+++ b/src/video/fbcon/SDL_fbevents.c
@@ -575,7 +575,7 @@ int FB_OpenMouse(_THIS)
/* ELO TOUCHSCREEN SUPPORT */
- if ( mousedrv && (SDL_strcmp(mousedrv, "ELO") == 0) ) {
+ if ( mousedrv && (SDL_strcmp(mousedrv, "ELO") == 0) && mousedev ) {
mouse_fd = open(mousedev, O_RDWR);
if ( mouse_fd >= 0 ) {
if(eloInitController(mouse_fd)) {
diff --git a/src/video/fbcon/SDL_fbmatrox.c b/src/video/fbcon/SDL_fbmatrox.c
index 04b90b05da..4e3da4f84d 100644
--- a/src/video/fbcon/SDL_fbmatrox.c
+++ b/src/video/fbcon/SDL_fbmatrox.c
@@ -80,6 +80,7 @@ static int FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
switch (dst->format->BytesPerPixel) {
case 1:
color |= (color<<8);
+ /* fallthrough */
case 2:
color |= (color<<16);
break;
@@ -191,6 +192,7 @@ static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
switch (dst->format->BytesPerPixel) {
case 1:
colorkey |= (colorkey<<8);
+ /* fallthrough */
case 2:
colorkey |= (colorkey<<16);
break;