Macoy Madson
7229f59adc
Added interface to raster only one shape
6 months ago
Macoy Madson
ae22b51cde
Add copyright to source files
6 months ago
Macoy Madson
5d01ca80ec
Fix Line endidngs, add my copyright
6 months ago
Mikko Mononen
bd16c4e6b2
Merge pull request #222 from 0vercl0k/fbl_fixoob2
Fix OOB in nsvg__parseUrl.
7 months ago
0vercl0k
402437f68a
Fix OOB in nsvg__parseUrl.
7 months ago
Mikko Mononen
7e37e00ef4
Merge pull request #220 from fltk/fix-rgb-color-locale
Make nsvg__parseColorRGB() independent of the current locale (#139 )
9 months ago
Mikko Mononen
ed3c01b809
Merge pull request #219 from fltk/fix-header-guards-eol
Fix newline at end of file, add comments
9 months ago
Albrecht Schlosser
d2002eeaf2
Make nsvg__parseColorRGB() independent of the current locale ( #139 )
This commit fixes the locale dependency (re-)introduced by commit
c3ad36ef81
by using sscanf() to parse
floating point values.
This modification uses nsvg__atof() which is independent of the
current locale.
9 months ago
Albrecht Schlosser
c73393fc7a
Fix newline at end of file, add comments
Fix "No newline at end of file" warning. The newline was removed
by commit 47f28a2a78
, probably unintentionally.
Add missing comments to #endif statements for clarity and consistency.
9 months ago
Mikko Mononen
3bcdf2f3cd
Merge pull request #215 from tamasmeszaros/tm_fix_includes
Fix build when both nanosvg.h and nanosvgrast.h is included
10 months ago
tamasmeszaros
47f28a2a78
Fix build when both nanosvg.h and nanosvgrast.h is included
with IMPLEMENTATION macros defined.
10 months ago
Mikko Mononen
4c8f0139b6
Merge pull request #209 from tamasmeszaros/cmake_build
Add CMake build script to the project
11 months ago
Mikko Mononen
4cd3610aee
Merge pull request #210 from chrstphrchvz/patch-2
Avoid calling `qsort()` when `r->nedges == 0`
11 months ago
Christopher Chavez
6c8ee8211a
Avoid calling qsort() when r->nedges == 0
In some unusual cases, r->nedges == 0 and r->edges == NULL.
At least glibc declares the array pointer for qsort() to be non-NULL,
causing UBSan (-fsanitize=nonnull-attribute) to complain.
11 months ago
tamasmeszaros
0985b6646b
Remove redundant line
11 months ago
tamasmeszaros
c995d1026e
Fix linking on MSVC
11 months ago
tamasmeszaros
b21ebe01b8
Add CMake build script to the project
Also add short description into readme
11 months ago
Mikko Mononen
03042a6297
Merge pull request #207 from chrstphrchvz/patch-1
Avoid signed integer overflow in nsvg__RGBA()
11 months ago
Christopher Chavez
c7f173b71b
Avoid signed integer overflow in nsvg__RGBA()
`a` is implicitly cast to (signed) `int` before shifting, and when `int`
is 32-bit, it is undefined behavior to left-shift `a` by 24 when its
most significant bit is 1. Error from UBSan (`-fsanitize=shift-base`):
nanosvgrast.h:975:41: runtime error: left shift of 255 by 24 places
cannot be represented in type 'int'
Casting `a` to `unsigned int` before shifting avoids undefined behavior.
11 months ago
Mikko Mononen
214cf85efc
Merge pull request #205 from AuthorityFX/master
Fixed rbg percentage parsing in nsvg__parseColorRGB
12 months ago
Ryan P. Wilson
a5486fa30d
roundf instead of round
move declaration of rgb floats to top of block
12 months ago
Ryan P. Wilson
c3ad36ef81
Fixed rbg percentage parsing in nsvg__parseColorRGB
12 months ago
Mikko Mononen
ccdb199513
Merge pull request #198 from ctrlcctrlv/CVE_2019_1000032
Fix decimal values in color fields (nsvg__parseColorRGB, nsvg__parseColorHex)
2 years ago
Greg Ercolano
419782d3d1
Fix decimal values in color fields (nsvg__parseColorRGB)
Closes #136 , fixes [CVE-2019-1000032](https://0day.work/cve-2019-1000032-memory-corruption-in-nanosvg/ ).
2 years ago
Mikko Mononen
3cdd4a9d78
Merge pull request #196 from oehhar/master
Fix for ticket #179 "division by 0" proposed by SergeySlice
2 years ago
Harald Oehlmann
44e5e4c765
Fix for ticket #179 "division by 0" proposed by SergeySlice
2 years ago
Mikko Mononen
3e403ec72a
Merge pull request #189 from fvogelnew1/Fix-for-#188
Update nanosvg.h
2 years ago
fvogelnew1
45eb9f8bcc
Update nanosvg.h
Fix https://github.com/memononen/nanosvg/issues/188
2 years ago
Mikko Mononen
cc6c08d3a8
Restore example2 test file
3 years ago
Mikko Mononen
ddd39e9669
Fix for #185
- prevent infinite loop when gradient ID is left to empty string
- prevent infinite loop when gradient references to self
- lookup up to 32 references back
3 years ago
Mikko Mononen
e7f5981b1e
Fix for #178
- make sure nsvg__addPath() hands only valid number of pointts (1+N*3)
- require moveTo path command before handling other commands
- require (sign+)digit for a valid path command coordinate
- allow to add bezier segment only after there’s at leat one point (now
also consistent with nsvg__lineTo)
3 years ago
Mikko Mononen
07a5e2a33c
Merge pull request #182 from oehhar/master
Ticket #178 : endless loop (DOS) when parsing crafted input via nsvgPa…
3 years ago
Harald Oehlmann
dac455fd94
Ticket #178 : endless loop (DOS) when parsing crafted input via nsvgParseFromFile()
Fix be fvogel
3 years ago
Mikko Mononen
25241c5a8f
Update README.md
4 years ago
Mikko Mononen
3e2a632c29
Merge pull request #152 from darealshinji/patch-2
don't cast long long -> double -> long long
4 years ago
Mikko Mononen
7cd94e3191
Merge pull request #154 from jzrake/master
Fix parsing of numbers with units ex and em
4 years ago
Jonathan Zrake
dc46f954b6
Fix parsing of numbers with units ex and em
Unrelated: kill precision warning in nsvg__atof, make expPart long.
4 years ago
darealshinji
8c360e4214
don't cast long long -> double -> long long
4 years ago
Mikko Mononen
c1f6e209c1
Merge pull request #145 from wcout/issue_139
Fix issue #139 : Nano SVG is still locale dependent
4 years ago
wcout
78e7627d10
Fix issue #139 : Nano SVG is still locale dependent
4 years ago
Mikko Mononen
2b08deeb55
Merge pull request #128 from poke1024/cpluscplus
Add option for cpp symbol export
5 years ago
Bernhard Liebl
773d84acaf
Add option for cpp symbol export
5 years ago
Mikko Mononen
35a45f3396
Merge branch 'pr/63'
5 years ago
Mikko Mononen
06c1f0f3bb
Merge pull request #116 from porglezomp-misc/master
Parse <svg> percentage width for automatic sizing
5 years ago
Caleb Jones
d6eabf29c9
Parse <svg> percentage width for automatic sizing
Instead of calculating percentage coordinates relative to 1px, we calculate them
relative to 0px width, that way an explicit <svg width="100%"> will be converted
to <svg width="0px"> and trigger the bounding-box sizing calculation.
5 years ago
Mikko Mononen
1f17a7ecea
Merge pull request #113 from martinlindhe/master
type fix: change nsvg__parseLineJoin() default value to NSVG_JOIN_MITER
5 years ago
Martin Lindhe
19bf258060
type fix: change nsvg__parseLineJoin() default value to NSVG_JOIN_MITER
5 years ago
Mikko Mononen
b0be83ba62
Merge pull request #112 from luzpaz/misc-typo
Misc. README typo
5 years ago
luz.paz
00574a8157
Misc. README typo
5 years ago
Mikko Mononen
9a74da4db5
Merge pull request #99 from nightlark/patch-1
Added missing 'S' in NanoSVG
6 years ago