Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133353701
D48031.id147819.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
794 B
Referenced Files
None
Subscribers
None
D48031.id147819.diff
View Options
diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c
--- a/sys/dev/sound/pcm/feeder_chain.c
+++ b/sys/dev/sound/pcm/feeder_chain.c
@@ -569,6 +569,9 @@
m->offset[x] = -1;
}
+#define FEEDER_FORMAT_SUPPORTED(fmt) \
+ ((fmt) & (AFMT_8BIT | AFMT_16BIT | AFMT_24BIT | AFMT_32BIT))
+
int
feeder_chain(struct pcm_channel *c)
{
@@ -697,6 +700,15 @@
cdesc.target.rate = c->speed;
}
+ /* Bail out early if we do not support either of those formats. */
+ if (!FEEDER_FORMAT_SUPPORTED(cdesc.origin.afmt) ||
+ !FEEDER_FORMAT_SUPPORTED(cdesc.target.afmt)) {
+ device_printf(c->dev,
+ "%s(): unsupported formats: in=0x%08x, out=0x%08x\n",
+ __func__, cdesc.origin.afmt, cdesc.target.afmt);
+ return (ENOTSUP);
+ }
+
d = c->parentsnddev;
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 26, 3:35 AM (50 m, 18 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24209788
Default Alt Text
D48031.id147819.diff (794 B)
Attached To
Mode
D48031: sound: Bail out early if a format is not supported
Attached
Detach File
Event Timeline
Log In to Comment