SkWuffsCodec: Do not swizzle frame of width 0

Bug: oss-fuzz:11769

The test image has a frame with width 0 whose left edge matches
the right edge of the image. If we were to attempt to swizzle,
this would read memory we shouldn't read. Check for a zero width
first.

Only compute scaledHeight once, and move it before the early return
to simplify the method.

Fix a comparison in an assert. It is okay for dstSwizzleBytes to be
equal to dstAllocatedBytes, so long as it is not greater, which would
mean we would write beyond the edge of the allocation.

Change-Id: If229ac926f01b74816d1a4ce714f114d20d2304e
Reviewed-on: https://skia-review.googlesource.com/c/175440
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Nigel Tao <nigeltao@google.com>
2 files changed