User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 Firefox/6.0
Build ID: 20110812233755
Steps to reproduce:
cppcheck found this uninitialized memory problem in the code.
in gfx/2d/SourceSurfaceCG.cpp in InitFromData(...) at line #113:
void *data = malloc(aStride * aSize.height);
memcpy(aData, data, aStride * aSize.height);
Well, the problem is that:
if you would like copy from data to aData, then data is uninitialized.
(Use calloc, or a memset befopre the copy, etc.)
If you would like copy from aData to data, then the order is wrong.
Fix this uninitialized data problem.
This is supposed to read memcpy(data, aData, aStride * aSize.height). Is this code actually used? I am amazed this hasn't been noticed before.
Created attachment 556387 [details] [diff] [review]
v1 patch to swap data and aData variable.
This is my patch to mozilla. Please let me know if I am missing something.
This code is not actually used at this point. As a matter of fact, it isn't even compiled, and it wouldn't compile if you tried to compile it :).
In my queue :-)
Thanks Atul :-)
Clearing good first bug status to get this off the good first bug buglist!