From 0837d1dfe28f8c461e23404ecb11b0bde1d16af2 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Tue, 16 Feb 2016 12:12:23 -0500 Subject: [PATCH 1/3] libx264: Fix noise_reduction option assignment First check the context, then check internal option. Drop the ! typo. Introduced in 60f0fde3092d18d4d36555962c192af8691a099c. --- libavcodec/libx264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 7798ef3648..8d72f1caa0 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -457,11 +457,11 @@ FF_ENABLE_DEPRECATION_WARNINGS x4->params.analyse.i_me_range = avctx->me_range; #if FF_API_PRIVATE_OPT FF_DISABLE_DEPRECATION_WARNINGS - if (!x4->noise_reduction >= 0) + if (avctx->noise_reduction >= 0) x4->noise_reduction = avctx->noise_reduction; FF_ENABLE_DEPRECATION_WARNINGS #endif - if (!x4->noise_reduction >= 0) + if (x4->noise_reduction >= 0) x4->params.analyse.i_noise_reduction = x4->noise_reduction; if (avctx->me_subpel_quality >= 0) x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; From f435d081b0a64b3a0c14f37bcdebed01df51d56a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 9 Feb 2016 17:25:49 -0500 Subject: [PATCH 2/3] h264: Add an AVClass pointer to H264Context Sample-Id: asan_heap-uaf_3660f67_757_cov_1257014655_Hi422FR1_SONY_A.jsv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer Signed-off-by: Vittorio Giovara --- libavcodec/h264.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 13b149fe48..72ad3525b8 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -465,6 +465,7 @@ typedef struct H264SliceContext { * H264Context */ typedef struct H264Context { + const AVClass *class; AVCodecContext *avctx; VideoDSPContext vdsp; H264DSPContext h264dsp; From 5e555f93009f0605db120eec78262d0fe337e645 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Mon, 8 Dec 2014 14:27:03 +0000 Subject: [PATCH 3/3] mpeg12enc: always write closed gops for intra only outputs Reviewed-by: Michael Niedermayer Signed-off-by: Marton Balint --- libavcodec/mpeg12enc.c | 2 +- tests/ref/lavf/mxf_d10 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 67bc467f5b..78605c5f69 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -331,7 +331,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) put_bits(&s->pb, 1, 1); put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60)); put_bits(&s->pb, 6, (uint32_t)((time_code % fps))); - put_bits(&s->pb, 1, !!(s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)); + put_bits(&s->pb, 1, !!(s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) || s->intra_only); put_bits(&s->pb, 1, 0); // broken link } } diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10 index 5864e8e5ce..8a62bb092a 100644 --- a/tests/ref/lavf/mxf_d10 +++ b/tests/ref/lavf/mxf_d10 @@ -1,3 +1,3 @@ -8cf467a910c84dd05db24848becba42e *./tests/data/lavf/lavf.mxf_d10 +96f933913835a439dd97144303dc8929 *./tests/data/lavf/lavf.mxf_d10 5330989 ./tests/data/lavf/lavf.mxf_d10 ./tests/data/lavf/lavf.mxf_d10 CRC=0x4474d480