diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index 1edd773..a1fe040 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -1174,7 +1174,14 @@ static int stretch_copybit_internal( src_image.handle = src_hnd; // Copy the source. - copy_image((private_handle_t *)src->handle, &src_image, CONVERT_TO_C2D_FORMAT); + status = copy_image((private_handle_t *)src->handle, &src_image, + CONVERT_TO_C2D_FORMAT); + if (status == COPYBIT_FAILURE) { + ALOGE("%s:copy_image failed in temp source",__FUNCTION__); + delete_handle(dst_hnd); + delete_handle(src_hnd); + return status; + } // Flush the cache IMemAlloc* memalloc = sAlloc->getAllocator(src_hnd->flags); @@ -1246,7 +1253,13 @@ static int stretch_copybit_internal( trg_mapped); if (needTempDestination) { // copy the temp. destination without the alignment to the actual destination. - copy_image(dst_hnd, dst, CONVERT_TO_ANDROID_FORMAT); + status = copy_image(dst_hnd, dst, CONVERT_TO_ANDROID_FORMAT); + if (status == COPYBIT_FAILURE) { + ALOGE("%s:copy_image failed in temp Dest",__FUNCTION__); + delete_handle(dst_hnd); + delete_handle(src_hnd); + return status; + } // Invalidate the cache. IMemAlloc* memalloc = sAlloc->getAllocator(dst_hnd->flags); memalloc->clean_buffer((void *)(dst_hnd->base), dst_hnd->size,