Commit Graph

1875 Commits

Author SHA1 Message Date
Kevin Croft
3b491aa07c
STB Vorbis: prevent division by zero in decode_resign if ch == 0
In the call to decode_residue:
  decode_residue(f, residue_buffers, ch, n2, r, do_not_decode);

The channel count is previously intialized as zero and incremented
based on a for-loop (f->channels) plus a conditional,
if (map->chan[j].mux == i).  If this doesn't happen then 'ch'
remains zero.

Once inside decode_residue(..), the code has three branches based
on channel count: stereo (ch == 2), mono (ch == 1), and then the
exception if it's neither of those (simple 'else').  It's in here
where a zero-valued 'ch' can be used as the denominator in these
calculations:
    int c_inter = z % ch
    p_inter = z/ch;

Obviously this 'else' branch is meant for channel counts greater
than two an not for zero channels; so this change simply makes
that branch only valid if (ch > 2).
2019-12-04 22:09:13 -08:00
Daniel Gibson
15516199e5 stb_image_write: Update JPEG code to jo_jpeg 1.60
For quality <= 90, it now supports subsampling U and V
so it encodes smaller files.

See https://www.jonolick.com/home/jo_jpeg-release-160 for more info
about jo_jpeg 1.60
2019-12-01 09:41:49 -01:00
Nathan Reed
4306eea3cb Fix VS2019 warning
- VS2019 on /W4 warns about applying '*' to enums. Fixed by casting to int.
2019-11-30 14:39:24 -08:00
Try
4148eb4d90 stb_image: fix CRC reading at the end of IEND chunk in png file 2019-11-18 19:25:38 +01:00
Andrew Kensler
57b9ea6510 Quell -Wcast-align warnings from Clang
The stbi__sbraw() macro in stb_image_write.h causes Clang to spew about 24
warnings complaining that "cast from 'unsigned char *' to 'int *' increases
required alignment from 1 to 4" when compiled with the -Wcast-align option.

In practice, this is spurious so long as STBIW_MALLOC() and STBIW_REALLOC()
follow the usual alignment semantics for malloc() and realloc() in that they
align sufficiently for any built-in type.

To quell the warning, we can cast through a void pointer as an intermediary.
2019-11-16 00:17:00 -08:00
Michal Klos
221a9efcfe added credits according to contributor guide 2019-11-11 14:21:41 +01:00
Michal Klos
cdf3ef1536 stb_include: fix stb_include_string iteration. Upper bound was incremented each loop instead of iterator causing endless loop when called 2019-11-11 13:59:19 +01:00
arlecchino
117e1741a2
stb_printf - added contributor 2019-11-05 17:43:20 +01:00
arlecchino
b97d06e0fa
fix: stb_sprintf - gcc defines __powerpc64__
Fix for stb_sprintf https://github.com/nothings/stb/issues/806
fixes #806
2019-11-05 17:39:22 +01:00
Sean Barrett
f67165c2bb
Update README.md 2019-10-28 09:30:02 -07:00
Dougall Johnson
da79a214ef stb_vorbis: improve fix for theoretical seek performance problem 2019-10-21 20:39:31 +11:00
Dougall Johnson
c3298670d0 stb_vorbis: fix a couple asserts that fail on invalid files 2019-10-21 15:37:04 +11:00
Dougall Johnson
057914d959 stb_vorbis: fix pushdata for files with audio packets in header pages
Fixes #259, #597
2019-10-20 14:42:28 +11:00
Andreas Haferburg
905d05a1d0 Fixed whitespace 2019-10-14 14:24:47 +02:00
Andreas Haferburg
c70479c47b Revert "Fixed whitespace"
This reverts commit 72646ac4ae.
2019-10-14 14:23:36 +02:00
Andreas Haferburg
72646ac4ae Fixed whitespace 2019-10-14 14:16:11 +02:00
Andreas Haferburg
df0c8e92d4 Fixed compiler warnings C4244 conversion from 'int' to 'unsigned char'/'unsigned short'. 2019-10-14 14:05:36 +02:00
cnlohr
e615214488 Fix bare backslash n as being a valid whitespace character. 2019-10-09 02:38:08 -04:00
Niclas Olmenius
da12942957 stb_image_write: fix clang warning
fix -Wmissing-variable-declarations clang warning

`stbi__flip_vertically_on_write` is now static like
`stbi__vertically_flip_on_load` in `stb_image.h`
2019-10-03 12:50:23 +02:00
Dougall Johnson
7c4eb44a63 stb_vorbis: fix seeking in files with audio packets in header pages
Fixes #682, #580
2019-10-01 20:47:29 +10:00
Dougall Johnson
2abc5c6ced stb_vorbis: fix seek_to_sample_coarse failure near page end 2019-10-01 16:50:21 +10:00
Dougall Johnson
6ca87a9e0e stb_vorbis: fix theoretical seek performance problem 2019-10-01 16:36:41 +10:00
Audino
2a0cff1288 Add comment support to stb_vorbis 2019-09-12 16:51:44 -07:00
BlackMATov
01b2d76baf stb_image.h: fix warning about unused function 'stbi__err'
Fixes issue #746.
2019-08-22 10:28:16 +07:00
Sean Barrett
052dce117e more fixing 2019-08-17 09:53:02 -07:00
Sean Barrett
657be5c654 fix README.md "noteworthy" links 2019-08-17 09:52:07 -07:00
Dima Krasner
791a907faa stb_leakcheck: add support for output to stderr 2019-08-13 13:09:56 +03:00
Sean Barrett
bcb2815ab3 stb_ds: add documentation for STBDS_UNIT_TESTS, -std=c++0x 2019-08-11 17:03:05 -07:00
Sean Barrett
c7343d4263 more Travis fixing 2019-08-11 16:45:14 -07:00
Sean Barrett
897c33133f more travis testing 2019-08-11 16:42:27 -07:00
Sean Barrett
5037e236ed try to work around Travis old GCC errors 2019-08-11 15:55:39 -07:00
Sean Barrett
76254f7758 Merge branch 'master' of https://github.com/nothings/stb 2019-08-11 14:39:51 -07:00
Sean Barrett
be594f1e0b stb_ds: maybe avoid problem with inferring template type from enum with gcc 2019-08-11 14:37:45 -07:00
Sean Barrett
4136af1b23
Merge pull request #789 from sjml/patch-2
typo in credit comment
2019-08-11 14:08:32 -07:00
Shane Liesegang
0cff58ecf8
very minor, non-urgent :) 2019-08-11 23:02:34 +02:00
Sean Barrett
787f1d646a Update version numbers 2019-08-11 05:38:37 -07:00
Sean Barrett
5072185467 stb_image: fix static analyzer warnings 2019-08-11 05:19:33 -07:00
Sean Barrett
a895aec686 stb_c_lexer: fix a static analysis warning 2019-08-11 05:19:00 -07:00
Sean Barrett
a2d540a689 stb.h: fix clang compile 2019-08-11 05:18:24 -07:00
Sean Barrett
b26a31072d test.sbm: tweak tests so all pass 2019-08-11 05:17:42 -07:00
Sean Barrett
846d15c102 image_test: tweak testing to open image in more modes 2019-08-11 04:58:48 -07:00
Sean Barrett
bd8d9a88bc test.sbm: add clang compilation 2019-08-11 04:57:39 -07:00
Sean Barrett
8ca86ee1a1 stb_perlin: add non-power-of-two wrapping noise 2019-08-11 04:56:12 -07:00
Sean Barrett
26a02f81ca stb_image: fix bug where bmp claimed to be 24-bit but also claimed to have an alpha bitfield 2019-08-11 04:54:52 -07:00
Sean Barrett
61be29d161 stb_ds: fix bug with shgeti not returning correct value 2019-08-11 04:53:51 -07:00
Sean Barrett
a5cbacd1c0 Merge branch 'fix-textedit-typo' of https://github.com/mastensg/stb into working 2019-08-11 04:33:11 -07:00
Sean Barrett
a5071ad702 Merge branch 'master' of https://github.com/rgriege/stb into working 2019-08-11 04:32:14 -07:00
Sean Barrett
70bd711831 Merge branch 'pull-request' of https://github.com/kaesve/stb into working 2019-08-11 04:26:55 -07:00
Sean Barrett
5c98e6564b stb_vorbis: fix typo in CVE number in docs 2019-08-11 04:26:23 -07:00
Sean Barrett
130f28df68 update readme 2019-08-09 12:37:57 -07:00