You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avcodec/flac_parser: avoid returning too negative number
If return value is very small parser code will assert.
This commit is contained in:
		| @@ -663,8 +663,11 @@ static int get_best_header(FLACParseContext *fpc, const uint8_t **poutbuf, | ||||
|  | ||||
|     /* Return the negative overread index so the client can compute pos. | ||||
|        This should be the amount overread to the beginning of the child */ | ||||
|     if (child) | ||||
|         return child->offset - flac_fifo_size(&fpc->fifo_buf); | ||||
|     if (child) { | ||||
|         int64_t offset = child->offset - flac_fifo_size(&fpc->fifo_buf); | ||||
|         if (offset > -(1 << 28)) | ||||
|             return offset; | ||||
|     } | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user