File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2531,14 +2531,23 @@ static CGFloat _get_device_scale(CGContextRef cr)
25312531       " CourierNewPS-Bold-ItalicMT"  },
25322532    };
25332533
2534-     if (!PyList_Check (family)) return  0 ;
2534+     if (!PyList_Check (family))
2535+     {
2536+         PyErr_SetString (PyExc_ValueError, " family should be a list"  );
2537+         return  0 ;
2538+     }
25352539    n = PyList_GET_SIZE (family);
25362540
25372541    for  (i = 0 ; i < n; i++)
25382542    {
25392543        PyObject* item = PyList_GET_ITEM (family, i);
25402544        ascii = PyUnicode_AsASCIIString (item);
2541-         if (!ascii) return  0 ;
2545+         if (!ascii)
2546+         {
2547+             PyErr_SetString (PyExc_ValueError,
2548+                             " failed to convert font family name to ASCII"  );
2549+             return  0 ;
2550+         }
25422551        temp = PyBytes_AS_STRING (ascii);
25432552        for  (j = 0 ; j < NMAP; j++)
25442553        {    if  (!strcmp (map[j].name , temp))
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments