avcodec/cuviddec: add capability check for maximum macroblock count
Cuvid supports clips with a limit on maximum number of macroblocks. This check was missing after cuvidGetDecoderCaps API call allowing unsupported clips to proceed. Added the missing check, same as the one in hwaccel nvdec implementation. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
		
							parent
							
								
									06ba4783a0
								
							
						
					
					
						commit
						80155795bb
					
				@ -805,6 +805,12 @@ static int cuvid_test_capabilities(AVCodecContext *avctx,
 | 
			
		||||
        return AVERROR(EINVAL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((probed_width * probed_height) / 256 > caps->nMaxMBCount) {
 | 
			
		||||
        av_log(avctx, AV_LOG_ERROR, "Video macroblock count %d exceeds maximum of %d\n",
 | 
			
		||||
               (int)(probed_width * probed_height) / 256, caps->nMaxMBCount);
 | 
			
		||||
        return AVERROR(EINVAL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user