Skip to content

Commit

Permalink
Fix a crash and another bug related to charset utf8.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-lipka committed Jan 27, 2017
1 parent 75f497c commit 07646c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Reported via FlySpray:
- FS#301 ("Fallback to default image size causes wrong values to be printed in message output")
- FS#321 ("FS#321 - bounding threshold inconsistency")

Reported via the Newsgroups:

- <[email protected]>
(2017-01-27, povray.beta-test, "utf8")
Crash when using `charset utf8`.

Miscellaneous:

- Optional fields in macro parameters or tuple assignments now accept
Expand Down
10 changes: 10 additions & 0 deletions revision.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ Notes:
POV-Ray v3.7.1-TBD
------------------------------------------------------------------------------

Commit 75f497c on 2017-01-26 by William F. Pokorny (wfpokorny)

[ci skip] Adding potential.pov demo scene to the distribution. (#220)

Also corrects small typo in unix/povray.1 manpage.

Commit de52f67 on 2017-01-25 by Christoph Lipka

Fix unix build error introduced with previous commit.

Commit 050584a on 2017-01-25 by Christoph Lipka

Make optional fields in macro parameters and tuple assignments accept
Expand Down
5 changes: 3 additions & 2 deletions source/parser/parser_strings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
/// Copyright 1991-2016 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2017 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -955,6 +955,7 @@ UCS2 *Parser::Convert_UTF8_To_UCS2(const unsigned char *text_array, int *char_ar

UCS2String s = UTF8toUCS2String(UTF8String(reinterpret_cast<const char*>(text_array)));
UCS2String::size_type len = s.length();
*char_array_size = len;

if (len == 0)
return NULL;
Expand All @@ -965,7 +966,7 @@ UCS2 *Parser::Convert_UTF8_To_UCS2(const unsigned char *text_array, int *char_ar
if(char_array == NULL)
throw POV_EXCEPTION_CODE(kOutOfMemoryErr);

memcpy(char_array, s.c_str(), size*sizeof(UCS2));
memcpy(char_array, s.c_str(), size);

return char_array;
}
Expand Down

0 comments on commit 07646c1

Please sign in to comment.