mirror of
				https://github.com/Ryujinx/GtkSharp.git
				synced 2025-11-04 13:04:53 +00:00 
			
		
		
		
	sample: Fix GtkDemo/DemoImages.cs on Windows
Calling .PeekChar on a binary stream can cause an ArgumentException because it tries to decode the byte.
This commit is contained in:
		
							parent
							
								
									a6c9634748
								
							
						
					
					
						commit
						233614e18b
					
				| 
						 | 
					@ -156,7 +156,7 @@ namespace GtkDemo
 | 
				
			||||||
				pixbufLoader.AreaUpdated += new AreaUpdatedHandler (ProgressiveUpdatedCallback);
 | 
									pixbufLoader.AreaUpdated += new AreaUpdatedHandler (ProgressiveUpdatedCallback);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (imageStream.PeekChar () != -1) {
 | 
								if (imageStream.BaseStream.Position != imageStream.BaseStream.Length) {
 | 
				
			||||||
				byte[] bytes = imageStream.ReadBytes (256);
 | 
									byte[] bytes = imageStream.ReadBytes (256);
 | 
				
			||||||
				pixbufLoader.Write (bytes);
 | 
									pixbufLoader.Write (bytes);
 | 
				
			||||||
				return true; // leave the timeout active
 | 
									return true; // leave the timeout active
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue