avformat/rtmpproto: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
							parent
							
								
									fd3e7447c8
								
							
						
					
					
						commit
						03b84f2fb2
					
				@ -217,9 +217,8 @@ static void free_tracked_methods(RTMPContext *rt)
 | 
				
			|||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (i = 0; i < rt->nb_tracked_methods; i ++)
 | 
					    for (i = 0; i < rt->nb_tracked_methods; i ++)
 | 
				
			||||||
        av_free(rt->tracked_methods[i].name);
 | 
					        av_freep(&rt->tracked_methods[i].name);
 | 
				
			||||||
    av_free(rt->tracked_methods);
 | 
					    av_freep(&rt->tracked_methods);
 | 
				
			||||||
    rt->tracked_methods      = NULL;
 | 
					 | 
				
			||||||
    rt->tracked_methods_size = 0;
 | 
					    rt->tracked_methods_size = 0;
 | 
				
			||||||
    rt->nb_tracked_methods   = 0;
 | 
					    rt->nb_tracked_methods   = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -2552,7 +2551,7 @@ static int inject_fake_duration_metadata(RTMPContext *rt)
 | 
				
			|||||||
    // Increase the size by the injected packet
 | 
					    // Increase the size by the injected packet
 | 
				
			||||||
    rt->flv_size += 55;
 | 
					    rt->flv_size += 55;
 | 
				
			||||||
    // Delete the old FLV data
 | 
					    // Delete the old FLV data
 | 
				
			||||||
    av_free(old_flv_data);
 | 
					    av_freep(&old_flv_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    p = rt->flv_data + 13;
 | 
					    p = rt->flv_data + 13;
 | 
				
			||||||
    bytestream_put_byte(&p, FLV_TAG_TYPE_META);
 | 
					    bytestream_put_byte(&p, FLV_TAG_TYPE_META);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user