Code: void nsc_encode(NSC_CONTEXT* context, const BYTE* bmpdata, UINT32 rowstride)
 {
	nsc_encode_argb_to_aycocg(context, bmpdata, rowstride);
 
 	if (context->ChromaSubsamplingLevel)
 	{
		nsc_encode_subsampling(context);
 	}
 }

Commit Message: Fixed CVE-2018-8788

Thanks to Eyal Itkin from Check Point Software Technologies.
CWE ID: CWE-787
void nsc_encode(NSC_CONTEXT* context, const BYTE* bmpdata, UINT32 rowstride)
BOOL nsc_encode(NSC_CONTEXT* context, const BYTE* bmpdata, UINT32 rowstride)
 {
	if (!context || !bmpdata || (rowstride == 0))
		return FALSE;

	if (!nsc_encode_argb_to_aycocg(context, bmpdata, rowstride))
		return FALSE;
 
 	if (context->ChromaSubsamplingLevel)
 	{
		if (!nsc_encode_subsampling(context))
			return FALSE;
 	}

	return TRUE;
 }
