archive/zzip: fix inverted error handler
Set the Error when zzip_seek()==-1 and not on success. Fixes a crash after seeking.
This commit is contained in:
		
							
								
								
									
										2
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								NEWS
									
									
									
									
									
								
							| @@ -1,4 +1,6 @@ | ||||
| ver 0.18.19 (not yet released) | ||||
| * archive | ||||
|   - zzip: fix crash after seeking | ||||
|  | ||||
| ver 0.18.18 (2014/11/18) | ||||
| * decoder | ||||
|   | ||||
| @@ -186,12 +186,13 @@ zzip_input_seek(InputStream *is, InputPlugin::offset_type offset, | ||||
| { | ||||
| 	ZzipInputStream *zis = (ZzipInputStream *)is; | ||||
| 	zzip_off_t ofs = zzip_seek(zis->file, offset, whence); | ||||
| 	if (ofs != -1) { | ||||
| 	if (ofs < 0) { | ||||
| 		error.Set(zzip_domain, "zzip_seek() has failed"); | ||||
| 		is->offset = ofs; | ||||
| 		return true; | ||||
| 		return false; | ||||
| 	} | ||||
| 	return false; | ||||
|  | ||||
| 	is->offset = ofs; | ||||
| 	return true; | ||||
| } | ||||
|  | ||||
| /* exported structures */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann