A bit less segfault-y
This commit is contained in:
		
							parent
							
								
									0e0d60c9a6
								
							
						
					
					
						commit
						a5122fd773
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -38,7 +38,7 @@ cammy_sram *cammy_sram_open(const char *file) {
 | 
				
			||||||
    sram->mapped_size = _mapped_size(st.st_size, sram->page_size);
 | 
					    sram->mapped_size = _mapped_size(st.st_size, sram->page_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((sram->data = mmap(NULL, sram->mapped_size,
 | 
					    if ((sram->data = mmap(NULL, sram->mapped_size,
 | 
				
			||||||
            PROT_READ, MAP_PRIVATE, sram->fd, 0)) == NULL) {
 | 
					            PROT_READ | PROT_WRITE, MAP_SHARED, sram->fd, 0)) == NULL) {
 | 
				
			||||||
        goto error_mmap;
 | 
					        goto error_mmap;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -116,7 +116,7 @@ int main(int argc, char **argv) {
 | 
				
			||||||
        goto error_png_get_data;
 | 
					        goto error_png_get_data;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    image_copy(&sram->data->frames[frame], buf);
 | 
					    image_copy(&sram->data->frames[frame-1], buf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    free(buf);
 | 
					    free(buf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue