From 494cbc4238db4db1f3bd2104e15bee4498b40cb4 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 30 Aug 2014 12:27:50 +0200 Subject: [PATCH 1/2] ffmpeg: Clean up if filter initialisation failed to avoid a memleak. Fixes ticket #3858. Reviewed-by: Nicolas George --- ffmpeg_filter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index b6dc42fe7d..7acff283c8 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -898,8 +898,11 @@ int configure_filtergraph(FilterGraph *fg) init_input_filter(fg, cur); for (cur = inputs, i = 0; cur; cur = cur->next, i++) - if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0) + if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0) { + avfilter_inout_free(&inputs); + avfilter_inout_free(&outputs); return ret; + } avfilter_inout_free(&inputs); if (!init || simple) { From f22c24bd7a57eca27ccc400dbb334b20db5fb050 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 30 Aug 2014 12:33:28 +0200 Subject: [PATCH 2/2] lavf/rtpdec_hevc: Fix compilation with -DDEBUG. --- libavformat/rtpdec_hevc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/rtpdec_hevc.c b/libavformat/rtpdec_hevc.c index 2cc76dcb0d..4504e1202c 100644 --- a/libavformat/rtpdec_hevc.c +++ b/libavformat/rtpdec_hevc.c @@ -128,7 +128,7 @@ static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s, hevc_data->using_donl_field = 1; #ifdef DEBUG - av_log(s, AV_LOG_DEBUG, "SDP: found sprop-max-don-diff in SDP, DON field usage is: %d\n", hevc_data->using_dons); + av_log(s, AV_LOG_DEBUG, "SDP: found sprop-max-don-diff in SDP, DON field usage is: %d\n", hevc_data->using_donl_field); #endif } @@ -138,7 +138,7 @@ static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s, hevc_data->using_donl_field = 1; #ifdef DEBUG - av_log(s, AV_LOG_DEBUG, "SDP: found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n", hevc_data->using_dons); + av_log(s, AV_LOG_DEBUG, "SDP: found sprop-depack-buf-nalus in SDP, DON field usage is: %d\n", hevc_data->using_donl_field); #endif } @@ -295,7 +295,7 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx /* A/V packet: copy NAL unit data */ memcpy(pkt->data + sizeof(start_sequence), buf, len); - COUNT_HEVC_NAL_TYPE(data, nal_type); + COUNT_HEVC_NAL_TYPE(rtp_hevc_ctx, nal_type); break; /* fragmentation unit (FU) */ @@ -367,7 +367,7 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx } if(!res){ - COUNT_HEVC_NAL_TYPE(data, fu_type); + COUNT_HEVC_NAL_TYPE(rtp_hevc_ctx, fu_type); } break;