Fixed bug number 10033.
This commit is contained in:
		
							parent
							
								
									8b723b54b4
								
							
						
					
					
						commit
						8d32ca76f1
					
				| 
						 | 
				
			
			@ -155,18 +155,30 @@ void vd_g_SaveBitmap(const ST_BITMAP * st_ap_bitmap, const char * sz_ap_path)
 | 
			
		|||
	do
 | 
			
		||||
	{
 | 
			
		||||
		if(st_ap_bitmap == NULL)
 | 
			
		||||
		{
 | 
			
		||||
			printf("st_ap_bitmap failed.\n");
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if((st_ap_bitmap->u2_bitcount != 16) && (st_ap_bitmap->u2_bitcount != 24) && (st_ap_bitmap->u2_bitcount != 32))
 | 
			
		||||
		{
 | 
			
		||||
			printf("st_ap_bitmap failed 2.\n");
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		if(sz_ap_path == NULL)
 | 
			
		||||
		{
 | 
			
		||||
			printf("sz_ap_path failed.\n");
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	
 | 
			
		||||
		file_bitmap = fopen(sz_ap_path, "wb");
 | 
			
		||||
		if(file_bitmap == NULL)
 | 
			
		||||
		{
 | 
			
		||||
			printf("fopen failed.\n");
 | 
			
		||||
			break;
 | 
			
		||||
 
 | 
			
		||||
		}
 | 
			
		||||
		printf("sz_ap_path = %s\n", sz_ap_path);
 | 
			
		||||
		// set bitmap head info
 | 
			
		||||
		vd_SerializeLittleEndianU4(&u1_tp_bitmap_header[2], sizeof(u1_tp_bitmap_header) + st_ap_bitmap->u4_image_size);
 | 
			
		||||
		vd_SerializeLittleEndianU4(&u1_tp_bitmap_header[10], sizeof(u1_tp_bitmap_header));
 | 
			
		||||
| 
						 | 
				
			
			@ -188,7 +200,7 @@ void vd_g_SaveBitmap(const ST_BITMAP * st_ap_bitmap, const char * sz_ap_path)
 | 
			
		|||
		
 | 
			
		||||
 
 | 
			
		||||
	} while(0);
 | 
			
		||||
	
 | 
			
		||||
	system("sync");
 | 
			
		||||
	if(file_bitmap)
 | 
			
		||||
		fclose(file_bitmap);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user