aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 24f4f2b..ef38c9c 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -677,8 +677,11 @@ int pcm_writei(struct pcm *pcm, const void *data, unsigned int frame_count)
if (pcm->flags & PCM_IN)
return -EINVAL;
- else if ((frame_count > TINYALSA_FRAMES_MAX)
- || (frame_count > INT_MAX))
+#if UINT_MAX > TINYALSA_FRAMES_MAX
+ if (frame_count > TINYALSA_FRAMES_MAX)
+ return -EINVAL;
+#endif
+ if (frame_count > INT_MAX)
return -EINVAL;
x.buf = (void*)data;
@@ -730,8 +733,11 @@ int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count)
if (!(pcm->flags & PCM_IN))
return -EINVAL;
- else if ((frame_count > TINYALSA_FRAMES_MAX)
- || (frame_count > INT_MAX))
+#if UINT_MAX > TINYALSA_FRAMES_MAX
+ if (frame_count > TINYALSA_FRAMES_MAX)
+ return -EINVAL;
+#endif
+ if (frame_count > INT_MAX)
return -EINVAL;
x.buf = data;