Fix SkTDArray::operator=

operator= did not work properly when the count of the src is 0. It
calls assign to do the bulk of the work, but assign assumed that
fCount and fReserve were 0.

Properly set fCount and fReserve in assign, and allocate the correct
amount of memory to copy the elements into.

This did not affect the constructors that use assign because the
assumption of fCount and fReserve being zero is true.

Bug: oss-fuzz:51868
Bug: oss-fuzz:51871
Bug: oss-fuzz:51873
Bug: oss-fuzz:51874
Bug: oss-fuzz:51875
Bug: oss-fuzz:51876
Bug: oss-fuzz:51877
Bug: oss-fuzz:51880
Change-Id: Iae472a4b3b6a08cd9e9c800e941773d4f36ce9f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/585149
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Herb Derby <herb@google.com>
1 file changed