ffmpeg: check if number of input and output channels are valid.
Fix Ticket887.
This commit is contained in:
		
				
					committed by
					
						
						Clément Bœsch
					
				
			
			
				
	
			
			
			
						parent
						
							95afa0a573
						
					
				
				
					commit
					ee4d43ef7a
				
			
							
								
								
									
										10
									
								
								ffmpeg.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								ffmpeg.c
									
									
									
									
									
								
							@@ -1096,8 +1096,14 @@ need_realloc:
 | 
			
		||||
                av_opt_set_int(ost->swr, "icl", av_get_default_channel_layout(ost->audio_channels_mapped), 0);
 | 
			
		||||
                av_opt_set_int(ost->swr, "uch", ost->audio_channels_mapped, 0);
 | 
			
		||||
            }
 | 
			
		||||
            av_opt_set_int(ost->swr, "ich", dec->channels, 0);
 | 
			
		||||
            av_opt_set_int(ost->swr, "och", enc->channels, 0);
 | 
			
		||||
            if (av_opt_set_int(ost->swr, "ich", dec->channels, 0) < 0) {
 | 
			
		||||
                av_log(NULL, AV_LOG_FATAL, "Unsupported number of input channels\n");
 | 
			
		||||
                exit_program(1);
 | 
			
		||||
            }
 | 
			
		||||
            if (av_opt_set_int(ost->swr, "och", enc->channels, 0) < 0) {
 | 
			
		||||
                av_log(NULL, AV_LOG_FATAL, "Unsupported number of output channels\n");
 | 
			
		||||
                exit_program(1);
 | 
			
		||||
            }
 | 
			
		||||
            if(audio_sync_method>1) av_opt_set_int(ost->swr, "flags", SWR_FLAG_RESAMPLE, 0);
 | 
			
		||||
            if(ost->swr && swr_init(ost->swr) < 0){
 | 
			
		||||
                av_log(NULL, AV_LOG_FATAL, "swr_init() failed\n");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user