avcodec/ffv1dec: Explicitly check read_quant_table() return value
Forwards the error code, avoids potential integer overflow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 10bbf6cf62)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
			
			
This commit is contained in:
		@@ -503,7 +503,10 @@ static int read_quant_tables(RangeCoder *c,
 | 
				
			|||||||
    int context_count = 1;
 | 
					    int context_count = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (i = 0; i < 5; i++) {
 | 
					    for (i = 0; i < 5; i++) {
 | 
				
			||||||
        context_count *= read_quant_table(c, quant_table[i], context_count);
 | 
					        int ret = read_quant_table(c, quant_table[i], context_count);
 | 
				
			||||||
 | 
					        if (ret < 0)
 | 
				
			||||||
 | 
					            return ret;
 | 
				
			||||||
 | 
					        context_count *= ret;
 | 
				
			||||||
        if (context_count > 32768U) {
 | 
					        if (context_count > 32768U) {
 | 
				
			||||||
            return AVERROR_INVALIDDATA;
 | 
					            return AVERROR_INVALIDDATA;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user