Fix buffer overrun bug in CPU upsample op (#1501)

This commit is contained in:
Changming Sun 2019-07-25 17:05:05 -07:00 committed by GitHub
parent 6df4bc2ebe
commit 1a115ed8cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -342,7 +342,7 @@ Status Upsample<T>::BaseCompute(OpKernelContext* context, const std::vector<floa
Tensor* Y = context->Output(0, Y_dims);
if (no_scale) {
memcpy(Y->MutableDataRaw(), X->DataRaw(), Y->Size() * sizeof(T));
memcpy(Y->MutableDataRaw(), X->DataRaw(), Y->Size());
return Status::OK();
}