Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149185520
D48031.1789644334.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
794 B
Referenced Files
None
Subscribers
None
D48031.1789644334.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
Thu, Sep 17, 11:25 AM (10 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29727752
Default Alt Text
D48031.1789644334.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