mirror of
				https://invent.kde.org/frameworks/kimageformats.git
				synced 2025-11-04 05:35:22 -05:00 
			
		
		
		
	ani: Make sure riffSizeData is of the correct size before doing the quint32_le cast dance
oss-fuzz/29290
This commit is contained in:
		@ -325,6 +325,9 @@ bool ANIHandler::ensureScanned() const
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const auto riffSizeData = device()->read(sizeof(quint32_le));
 | 
			
		||||
    if (riffSizeData.size() != sizeof(quint32_le)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    const auto riffSize = *(reinterpret_cast<const quint32_le *>(riffSizeData.data()));
 | 
			
		||||
    // TODO do a basic sanity check if the size is enough to hold some metadata and a frame?
 | 
			
		||||
    if (riffSize == 0) {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user