DarknessVoided / maplelib2

Automatically exported from code.google.com/p/maplelib2
0 stars 0 forks source link

WzCanvasProperty Write NullReferenceException #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Star a new C# project, include MapleLib.
2. Make a for loop to loop through Mob.wz modifying bodyAttack, then setting 
ParentImage.Changed to true.
3. After the foor loop is done looping, run wzFile.SaveToDisk(fileName) and the 
error should show up, pointing to a NullReferenceException at 
WzCanvasProperty.write->write(bytes.length + 1)

What is the expected output? What do you see instead?
Expected: Saves the newly modified wz file.
Outcome: NullReferenceException found during the writing of WzCanvasProperty, 
as if the PngProperty(Image) is missing.

What version of the product are you using? On what operating system?
Latest Revision as of Nov 26, 2010, Visual Studio 2010 on windows XP SP3, and 
on Maplestory v92.

Please provide any additional information below.
Was going about making a quick little patcher to sort through the monsters that 
I would want to filter out in a PQ, setting the bodyAttack value to 0, and 
deleting the move properties, as well as setting lt/rb to 0. Might just be this 
old computer though, will test again on other computers.

Original issue reported on code.google.com by vangphe...@gmail.com on 26 Nov 2010 at 5:03

Attachments:

GoogleCodeExporter commented 8 years ago
Not sure, but what's the point of creating an array of bytes that gets 
compressed bytes from PngProperty that returns null, and then trying to add 1 
to a NULL length array of byte before writing it to the file? Isn't it better 
just to check to see if the array of bytes is null, and IF so, then write 1 as 
the length and 00 as the byte data?

Original comment by vangphe...@gmail.com on 28 Nov 2010 at 8:02

GoogleCodeExporter commented 8 years ago
The point is that the array should NOT be null, not that the library is having 
problems dealing with the possibility of a null array. Writing a data of 00 
with length one would indeed save the file but corrupt the PNGs in it. I'm 
currently looking into it; expect a fix soon.

Original comment by haha01ha...@gmail.com on 27 Jan 2011 at 11:37

GoogleCodeExporter commented 8 years ago
Thanks for the reply, I'll checkout the latest rev from the SVN repo and see
how it goes.

Original comment by vangphe...@gmail.com on 2 Feb 2011 at 9:06