modplug: use only decoder_read(), not input_stream_read()
You are allowed to call decoder_read() with decoder==NULL. It is a convenience function provided by the decoder API. Don't manually fall back to input_stream_read().
This commit is contained in:
		@@ -48,11 +48,7 @@ static GByteArray *mod_loadfile(struct decoder *decoder, struct input_stream *is
 | 
				
			|||||||
	data = g_malloc(MODPLUG_READ_BLOCK);
 | 
						data = g_malloc(MODPLUG_READ_BLOCK);
 | 
				
			||||||
	total_len = 0;
 | 
						total_len = 0;
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
		if (decoder) {
 | 
							ret = decoder_read(decoder, is, data, MODPLUG_READ_BLOCK);
 | 
				
			||||||
			ret = decoder_read(decoder, is, data, MODPLUG_READ_BLOCK);
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			ret = input_stream_read(is, data, MODPLUG_READ_BLOCK);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if (ret > 0) {
 | 
							if (ret > 0) {
 | 
				
			||||||
			g_byte_array_append(bdatas, data, ret);
 | 
								g_byte_array_append(bdatas, data, ret);
 | 
				
			||||||
			total_len += ret;
 | 
								total_len += ret;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user