avcodec/v4l2_m2m_dec: Fix memleak on ff_v4l2_m2m_codec_init() failure
Fixes: 13579/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1_V4L2M2M_fuzzer-5753560726241280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		
							parent
							
								
									640e401aed
								
							
						
					
					
						commit
						e5f92f3fba
					
				@ -188,7 +188,11 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    ret = ff_v4l2_m2m_codec_init(avctx);
 | 
					    ret = ff_v4l2_m2m_codec_init(avctx);
 | 
				
			||||||
    if (ret) {
 | 
					    if (ret) {
 | 
				
			||||||
 | 
					        V4L2m2mPriv *priv = avctx->priv_data;
 | 
				
			||||||
        av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
 | 
					        av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
 | 
				
			||||||
 | 
					        s->self_ref = NULL;
 | 
				
			||||||
 | 
					        av_buffer_unref(&priv->context_ref);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return ret;
 | 
					        return ret;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user