SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
42
audio/sox/patches/patch-src_formats_i_c
Normal file
42
audio/sox/patches/patch-src_formats_i_c
Normal file
|
@ -0,0 +1,42 @@
|
|||
https://marc.info/?l=oss-security&m=167571683504082&w=2
|
||||
|
||||
Index: src/formats_i.c
|
||||
--- src/formats_i.c.orig
|
||||
+++ src/formats_i.c
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "sox_i.h"
|
||||
+#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
@@ -60,13 +61,24 @@ int lsx_check_read_params(sox_format_t * ft, unsigned
|
||||
if (ft->seekable)
|
||||
ft->data_start = lsx_tell(ft);
|
||||
|
||||
- if (channels && ft->signal.channels && ft->signal.channels != channels)
|
||||
+ if (channels && ft->signal.channels && ft->signal.channels != channels) {
|
||||
lsx_warn("`%s': overriding number of channels", ft->filename);
|
||||
- else ft->signal.channels = channels;
|
||||
+ } else if (channels > SHRT_MAX) {
|
||||
+ lsx_fail_errno(ft, EINVAL, "implausibly large number of channels");
|
||||
+ return SOX_EOF;
|
||||
+ } else {
|
||||
+ ft->signal.channels = channels;
|
||||
+ }
|
||||
|
||||
- if (rate && ft->signal.rate && ft->signal.rate != rate)
|
||||
+ if (rate && ft->signal.rate && ft->signal.rate != rate) {
|
||||
lsx_warn("`%s': overriding sample rate", ft->filename);
|
||||
- else ft->signal.rate = rate;
|
||||
+ /* Since NaN comparisons yield false, the negation rejects them. */
|
||||
+ } else if (!(rate > 0)) {
|
||||
+ lsx_fail_errno(ft, EINVAL, "invalid rate value");
|
||||
+ return SOX_EOF;
|
||||
+ } else {
|
||||
+ ft->signal.rate = rate;
|
||||
+ }
|
||||
|
||||
if (encoding && ft->encoding.encoding && ft->encoding.encoding != encoding)
|
||||
lsx_warn("`%s': overriding encoding type", ft->filename);
|
Loading…
Add table
Add a link
Reference in a new issue