[FFmpeg-cvslog] avcodec/pthread_frame: Simplify code by using av_reallocp_array()
ffmpeg | branch: master | Michael Niedermayer | Sat Nov 1 10:51:08 2014 +0100| [842745fe1705a6e7504aadd60c0d415ae35fe651] | committer: Michael Niedermayer avcodec/pthread_frame: Simplify code by using av_reallocp_array() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=842745fe1705a6e7504aadd60c0d415ae35fe651 --- libavcodec/pthread_frame.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index e4f92d9..fa1c50a 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -286,13 +286,10 @@ FF_ENABLE_DEPRECATION_WARNINGS if (src->slice_count && src->slice_offset) { if (dst->slice_count < src->slice_count) { -int *tmp = av_realloc(dst->slice_offset, src->slice_count * - sizeof(*dst->slice_offset)); -if (!tmp) { -av_free(dst->slice_offset); -return AVERROR(ENOMEM); -} -dst->slice_offset = tmp; +int err = av_reallocp_array(&dst->slice_offset, src->slice_count, +sizeof(*dst->slice_offset)); +if (err < 0) +return err; } memcpy(dst->slice_offset, src->slice_offset, src->slice_count * sizeof(*dst->slice_offset)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/parser: use av_freep() to avoid leaving stale pointers in memory
ffmpeg | branch: master | Michael Niedermayer | Sat Nov 1 10:50:18 2014 +0100| [cc769931ab0ce8440cc3dd863b3d6a036ab9608b] | committer: Michael Niedermayer avcodec/parser: use av_freep() to avoid leaving stale pointers in memory Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc769931ab0ce8440cc3dd863b3d6a036ab9608b --- libavcodec/parser.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/parser.c b/libavcodec/parser.c index 55c2f52..d1e1574 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -212,7 +212,7 @@ void av_parser_close(AVCodecParserContext *s) if (s) { if (s->parser->parser_close) s->parser->parser_close(s); -av_free(s->priv_data); +av_freep(&s->priv_data); av_free(s); } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pthread_slice: Use av_freep() to avoid leaving stale pointers in memory
ffmpeg | branch: master | Michael Niedermayer | Sat Nov 1 11:22:06 2014 +0100| [e5054c8eed339283f352c70d191b35b3c3db227e] | committer: Michael Niedermayer avcodec/pthread_slice: Use av_freep() to avoid leaving stale pointers in memory Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5054c8eed339283f352c70d191b35b3c3db227e --- libavcodec/pthread_slice.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pthread_slice.c b/libavcodec/pthread_slice.c index fea989f..b948e16 100644 --- a/libavcodec/pthread_slice.c +++ b/libavcodec/pthread_slice.c @@ -120,7 +120,7 @@ void ff_slice_thread_free(AVCodecContext *avctx) pthread_mutex_destroy(&c->current_job_lock); pthread_cond_destroy(&c->current_job_cond); pthread_cond_destroy(&c->last_job_cond); -av_free(c->workers); +av_freep(&c->workers); av_freep(&avctx->internal->thread_ctx); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 3600c44 web/security: add CVEs for 2.4.2, 2.3.4, 2.2.9 and 1.2.9
The branch, master has been updated via 3600c4492057c34e48f6ea5b75b161791d29f9a5 (commit) from 3dfacd7cc896e98d148f95dbf74bfd341ed5081b (commit) - Log - commit 3600c4492057c34e48f6ea5b75b161791d29f9a5 Author: Michael Niedermayer AuthorDate: Sat Nov 1 12:57:17 2014 +0100 Commit: Michael Niedermayer CommitDate: Sat Nov 1 12:58:22 2014 +0100 web/security: add CVEs for 2.4.2, 2.3.4, 2.2.9 and 1.2.9 diff --git a/src/security b/src/security index 32423de..e7e4bdd 100644 --- a/src/security +++ b/src/security @@ -1,7 +1,33 @@ Please report vulnerabilities to mailto:ffmpeg-secur...@ffmpeg.org";>ffmpeg-secur...@ffmpeg.org + + +2.4.2 + +Fixes following vulnerabilities: + + +CVE-2014-8541, 6f5c5051096a842d49b8ae3b10462a6098d4b890 / 5c378d6a6df8243f06c87962b873bd563e58cd39 +CVE-2014-8542, f7c0f8355e5d3a2a5749676d32aec6ea437da984 / 105654e376a736d243aef4a1d121abebce912e6b +CVE-2014-8543, 03d30d4c2c4d622ffd8b5603e6c41a7ca1151245 / 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e +CVE-2014-8544, f6476944e1a70e1639ad45791cf94972e66ae5bb / e1c0cfaa419aa5d320540d5a1b3f8fd9b82ab7e5 +CVE-2014-8545, d9bef14e41a49b3ea2be407d02f0fe8d4c4a92eb / 3e2b745020c2dbf0201fe7df3dad9e7e0b2e1bb6 +CVE-2014-8546, 71f0a3c4adcf86303ed53696a70bb7398ae63c69 / e7e5114c506957f40aafd794e06de1a7e341e9d5 +CVE-2014-8547, 7f90eef87ac84c617b102b689eb68e7cb140167b / 8f1457864be8fb9653643519dea1c6492f1dde57 +CVE-2014-8548, c0c24bc9b32419c7883a344c74a6779374a3c16a / c727401aa9d62335e89d118a5b4e202edf39d905 +CVE-2014-8549, 84d26ab6eb07e22ad6ffcd8109ca1d1a0cd57bce / 550f3e9df3410b3dd975e590042c0d83e20a8da3 + + FFmpeg 2.3 +2.3.4 + +Fixes following vulnerabilities: + + + CVE-2014-8541, 57bdb3f3dde3de7e84c888ae205574873bd1787b / 5c378d6a6df8243f06c87962b873bd563e58cd39 + + 2.3.3 Fixes following vulnerabilities: @@ -29,6 +55,21 @@ CVE-2014-4610, d6af26c55c1ea30f85a7d9edbc373f53be1743ee FFmpeg 2.2 +2.2.9 + +Fixes following vulnerabilities: + + +CVE-2014-8541, 6287107eae40750f47ec3888c52fd94a9c697b38 / 5c378d6a6df8243f06c87962b873bd563e58cd39 +CVE-2014-8542, e5ccd894d1c1c07c39876b650b2993de16547fb0 / 105654e376a736d243aef4a1d121abebce912e6b +CVE-2014-8543, f2c6e2c3b4ee0b0b8e202ef2d8a6f3780d20595f / 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e +CVE-2014-8544, f8bd98ae4d691fa7405856d83ca3d304429cc6f0 / e1c0cfaa419aa5d320540d5a1b3f8fd9b82ab7e5 +CVE-2014-8545, 64be1a45eb2604deca259319780ce02bd921859b / 3e2b745020c2dbf0201fe7df3dad9e7e0b2e1bb6 +CVE-2014-8546, 42bdcebf3360fca957e8224ff0a6573b05dbc249 / e7e5114c506957f40aafd794e06de1a7e341e9d +CVE-2014-8547, 43881c773277c90ccb0dbfd2d5c3afd8f8603597 / 8f1457864be8fb9653643519dea1c6492f1dde57 +CVE-2014-8548, b0964918d882dd3ae589f76df01551ca0234d910 / c727401aa9d62335e89d118a5b4e202edf39d905 + + 2.2.7 Fixes following vulnerabilities: @@ -182,6 +223,21 @@ CVE-2013-3675, 9dd04f6d8cdd1c10c28b2cb4252c1a41df581915 FFmpeg 1.2 +1.2.9 + +Fixes following vulnerabilities: + + +CVE-2014-8541, 0ffa44340f247e5d24d006726ecc9c66c55dcf22 / 5c378d6a6df8243f06c87962b873bd563e58cd39 +CVE-2014-8542, e90d620cb93eb23a17b8803d8bb164c903633378 / 105654e376a736d243aef4a1d121abebce912e6b +CVE-2014-8543, 76601e4ab8f5d304906766bffabefbc3791819e9 / 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e +CVE-2014-8544, f56095c4d7e5a76be8b114bcf427ab0becf0c635 / e1c0cfaa419aa5d320540d5a1b3f8fd9b82ab7e5 +CVE-2014-8545, 12c8e4021c2db6c714bc0d419820c274f19333fc / 3e2b745020c2dbf0201fe7df3dad9e7e0b2e1bb6 +CVE-2014-8546, 75f5fe165cedc63ea89514b3e9f6da67fd1038ec / e7e5114c506957f40aafd794e06de1a7e341e9d5 +CVE-2014-8547, 24a5cd720d579634ab7140f4cb7fa09fe4b780e4 / 8f1457864be8fb9653643519dea1c6492f1dde57 +CVE-2014-8548, 4865948d2ea9d239ce0ebfe40420d111799ee742 / c727401aa9d62335e89d118a5b4e202edf39d905 + + 1.2.8 Fixes following vulnerabilities: --- Summary of changes: src/security | 56 1 files changed, 56 insertions(+), 0 deletions(-) hooks/post-receive -- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 2e49c72 web/security: Fix typo on h2 tag
The branch, master has been updated via 2e49c7286d0185edd44ea8be92df2c7fe99f1f80 (commit) from 3600c4492057c34e48f6ea5b75b161791d29f9a5 (commit) - Log - commit 2e49c7286d0185edd44ea8be92df2c7fe99f1f80 Author: Michael Niedermayer AuthorDate: Sat Nov 1 13:02:08 2014 +0100 Commit: Michael Niedermayer CommitDate: Sat Nov 1 13:02:08 2014 +0100 web/security: Fix typo on h2 tag diff --git a/src/security b/src/security index e7e4bdd..a32454c 100644 --- a/src/security +++ b/src/security @@ -1,6 +1,6 @@ Please report vulnerabilities to mailto:ffmpeg-secur...@ffmpeg.org";>ffmpeg-secur...@ffmpeg.org - +FFmpeg 2.4 2.4.2 --- Summary of changes: src/security |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hevc_mvs: make sure to always initialize the temporal MV fully
ffmpeg | branch: release/2.4 | Anton Khirnov | Mon Sep 29 16:25:14 2014 +| [0b41eeac45fb7f7ad6d3f4fc846b00d108824b0b] | committer: Vittorio Giovara hevc_mvs: make sure to always initialize the temporal MV fully The spec requires this. Fixes uninitialized reads on some samples. Remove now unnecessary initialization of the whole merge candidate list. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0b41eeac45fb7f7ad6d3f4fc846b00d108824b0b --- libavcodec/hevc_mvs.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c index 8b172a2..721eb3a 100644 --- a/libavcodec/hevc_mvs.c +++ b/libavcodec/hevc_mvs.c @@ -481,14 +481,10 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0, mergecandlist[nb_merge_cand].is_intra = 0; mergecandlist[nb_merge_cand].pred_flag[0] = available_l0; mergecandlist[nb_merge_cand].pred_flag[1] = available_l1; -if (available_l0) { -mergecandlist[nb_merge_cand].mv[0] = mv_l0_col; -mergecandlist[nb_merge_cand].ref_idx[0] = 0; -} -if (available_l1) { -mergecandlist[nb_merge_cand].mv[1] = mv_l1_col; -mergecandlist[nb_merge_cand].ref_idx[1] = 0; -} +AV_ZERO16(mergecandlist[nb_merge_cand].ref_idx); +mergecandlist[nb_merge_cand].mv[0] = mv_l0_col; +mergecandlist[nb_merge_cand].mv[1] = mv_l1_col; + if (merge_idx == nb_merge_cand) return; nb_merge_cand++; @@ -558,8 +554,6 @@ void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW, int nPbH2 = nPbH; HEVCLocalContext *lc = &s->HEVClc; -memset(mergecand_list, 0, MRG_MAX_NUM_CANDS * sizeof(*mergecand_list)); - if (s->pps->log2_parallel_merge_level > 2 && nCS == 8) { singleMCLFlag = 1; x0= lc->cu.x; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '0b41eeac45fb7f7ad6d3f4fc846b00d108824b0b' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer | Sat Nov 1 13:06:25 2014 +0100| [0ddcee172ec8a8abc91c61c3a66bbfd432373976] | committer: Michael Niedermayer Merge commit '0b41eeac45fb7f7ad6d3f4fc846b00d108824b0b' into release/2.4 * commit '0b41eeac45fb7f7ad6d3f4fc846b00d108824b0b': hevc_mvs: make sure to always initialize the temporal MV fully Conflicts: libavcodec/hevc_mvs.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ddcee172ec8a8abc91c61c3a66bbfd432373976 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hevc_mvs: initialize the temporal MV in case of missing ref
ffmpeg | branch: release/2.4 | Anton Khirnov | Mon Sep 29 16:16:50 2014 +| [de31f857077a52714f3a2f2e92ac037d42d37769] | committer: Vittorio Giovara hevc_mvs: initialize the temporal MV in case of missing ref The caller expects the MV to always be initialized. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de31f857077a52714f3a2f2e92ac037d42d37769 --- libavcodec/hevc_mvs.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c index a611b76..8b172a2 100644 --- a/libavcodec/hevc_mvs.c +++ b/libavcodec/hevc_mvs.c @@ -257,8 +257,10 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0, HEVCFrame *ref = s->ref->collocated_ref; -if (!ref) +if (!ref) { +memset(mvLXCol, 0, sizeof(*mvLXCol)); return 0; +} tab_mvf = ref->tab_mvf; colPic = ref->poc; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'de31f857077a52714f3a2f2e92ac037d42d37769' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer | Sat Nov 1 13:05:46 2014 +0100| [13ecdb06f8503c852546b017e7e861e10d9f416f] | committer: Michael Niedermayer Merge commit 'de31f857077a52714f3a2f2e92ac037d42d37769' into release/2.4 * commit 'de31f857077a52714f3a2f2e92ac037d42d37769': hevc_mvs: initialize the temporal MV in case of missing ref Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13ecdb06f8503c852546b017e7e861e10d9f416f --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'ca8c62d187fdca13979379fb2ab172ed662aa2f8' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer | Sat Nov 1 13:22:09 2014 +0100| [20071ff1a4ba0730455995e354d5168c46d1cd71] | committer: Michael Niedermayer Merge commit 'ca8c62d187fdca13979379fb2ab172ed662aa2f8' into release/2.4 * commit 'ca8c62d187fdca13979379fb2ab172ed662aa2f8': resample: Avoid off-by-1 errors in PTS calcs. Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=20071ff1a4ba0730455995e354d5168c46d1cd71 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'e443165c323406d01da7e7930f042d265d01fb35' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer | Sat Nov 1 13:21:40 2014 +0100| [3b7db9c4f55ddc51f5f29d169d379fe2c6402b11] | committer: Michael Niedermayer Merge commit 'e443165c323406d01da7e7930f042d265d01fb35' into release/2.4 * commit 'e443165c323406d01da7e7930f042d265d01fb35': imc: fix order of operations in coefficients read Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b7db9c4f55ddc51f5f29d169d379fe2c6402b11 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] imc: fix order of operations in coefficients read
ffmpeg | branch: release/2.4 | Vittorio Giovara | Mon Oct 13 15:42:28 2014 +0100| [e443165c323406d01da7e7930f042d265d01fb35] | committer: Vittorio Giovara imc: fix order of operations in coefficients read Reported-by: Ruoyu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e443165c323406d01da7e7930f042d265d01fb35 --- libavcodec/imc.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 41ca8c8..500f564 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -873,14 +873,14 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch) flag = get_bits1(&q->gb); if (stream_format_code & 0x1) -imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf, - chctx->flcoeffs1, chctx->flcoeffs2); -else if (stream_format_code & 0x1) imc_read_level_coeffs_raw(q, stream_format_code, chctx->levlCoeffBuf); else imc_read_level_coeffs(q, stream_format_code, chctx->levlCoeffBuf); -if (stream_format_code & 0x4) +if (stream_format_code & 0x1) +imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf, + chctx->flcoeffs1, chctx->flcoeffs2); +else if (stream_format_code & 0x4) imc_decode_level_coefficients(q, chctx->levlCoeffBuf, chctx->flcoeffs1, chctx->flcoeffs2); else ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] resample: Avoid off-by-1 errors in PTS calcs.
ffmpeg | branch: release/2.4 | Timothy B. Terriberry | Mon Oct 13 17:46:00 2014 -0700| [ca8c62d187fdca13979379fb2ab172ed662aa2f8] | committer: Anton Khirnov resample: Avoid off-by-1 errors in PTS calcs. The rounding used in the PTS calculations in filter_frame() does not actually match the number of samples output by the resampler. This leads to off-by-1 errors in the timestamps indicating gaps and underruns, even when the input timestamps are all contiguous. Bug-Id: 753 Signed-off-by: Anton Khirnov (cherry picked from commit 6cbbf0592f4f3940aac7f687850d1b726a2ea836) Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca8c62d187fdca13979379fb2ab172ed662aa2f8 --- libavfilter/af_resample.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c index bc8fd8a..a59e6f8 100644 --- a/libavfilter/af_resample.c +++ b/libavfilter/af_resample.c @@ -42,6 +42,7 @@ typedef struct ResampleContext { AVDictionary *options; int64_t next_pts; +int64_t next_in_pts; /* set by filter_frame() to signal an output frame to request_frame() */ int got_output; @@ -154,6 +155,7 @@ static int config_output(AVFilterLink *outlink) outlink->time_base = (AVRational){ 1, outlink->sample_rate }; s->next_pts= AV_NOPTS_VALUE; +s->next_in_pts = AV_NOPTS_VALUE; av_get_channel_layout_string(buf1, sizeof(buf1), -1, inlink ->channel_layout); @@ -255,7 +257,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } out->sample_rate = outlink->sample_rate; -if (in->pts != AV_NOPTS_VALUE) { +/* Only convert in->pts if there is a discontinuous jump. + This ensures that out->pts tracks the number of samples actually + output by the resampler in the absence of such a jump. + Otherwise, the rounding in av_rescale_q() and av_rescale() + causes off-by-1 errors. */ +if (in->pts != AV_NOPTS_VALUE && in->pts != s->next_in_pts) { out->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base) - av_rescale(delay, outlink->sample_rate, @@ -264,6 +271,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) out->pts = s->next_pts; s->next_pts = out->pts + out->nb_samples; +s->next_in_pts = in->pts + in->nb_samples; ret = ff_filter_frame(outlink, out); s->got_output = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc: fix qp count
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 13 16:02:42 2014 +0200| [bf7ee2524b8db7207035309b36cafa9f1a48d5b0] | committer: Michael Niedermayer postproc: fix qp count Found-by: ubitux Signed-off-by: Michael Niedermayer (cherry picked from commit 0b7e5d0d75e7d8762dd04d35f8c0821736164372) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf7ee2524b8db7207035309b36cafa9f1a48d5b0 --- libpostproc/postprocess.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index ab12e59..670908c 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -979,7 +979,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if(pict_type & PP_PICT_TYPE_QP2){ int i; -const int count= mbHeight * absQPStride; +const int count= FFMAX(mbHeight * absQPStride, mbWidth); for(i=0; i<(count>>2); i++){ ((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F; } @@ -1004,7 +1004,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if((pict_type&7)!=3){ if (QPStride >= 0){ int i; -const int count= mbHeight * FFMAX(QPStride, mbWidth); +const int count= FFMAX(mbHeight * QPStride, mbWidth); for(i=0; i<(count>>2); i++){ ((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vf_drawtext: add missing clear of pointers after av_expr_free()
ffmpeg | branch: release/2.4 | Karl Kiniger | Sat Oct 11 22:34:11 2014 +0200| [71af22097d33b9133265977a113bc732bf42ede5] | committer: Michael Niedermayer vf_drawtext: add missing clear of pointers after av_expr_free() Fixes segfault when using sendcmd with drawtext. Since LIBAVFILTER_VERSION_MAJOR 5 FF_API_DRAWTEXT_OLD_TIMELINE evaluates to 0. Signed-off-by: Karl Kiniger Signed-off-by: Michael Niedermayer (cherry picked from commit 903156aa8a352a5df34cd1e34c21b2193a447d5e) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=71af22097d33b9133265977a113bc732bf42ede5 --- libavfilter/vf_drawtext.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 4fbb6c0..5b725d6 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -716,6 +716,8 @@ static av_cold void uninit(AVFilterContext *ctx) #if FF_API_DRAWTEXT_OLD_TIMELINE av_expr_free(s->draw_pexpr); s->x_pexpr = s->y_pexpr = s->draw_pexpr = NULL; +#else +s->x_pexpr = s->y_pexpr = NULL; #endif av_freep(&s->positions); s->nb_positions = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavd: export all symbols with av_ prefix
ffmpeg | branch: release/2.4 | Lukasz Marek | Mon Oct 20 12:12:20 2014 +0200| [e4d921dc71cdf4d813c3e64bb7ade8536b17971c] | committer: Michael Niedermayer lavd: export all symbols with av_ prefix Signed-off-by: Lukasz Marek (cherry picked from commit e493814d6191c6dd2900296df546b5f5c7e4452d) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e4d921dc71cdf4d813c3e64bb7ade8536b17971c --- libavdevice/libavdevice.v |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/libavdevice.v b/libavdevice/libavdevice.v index 663af85..de7278c 100644 --- a/libavdevice/libavdevice.v +++ b/libavdevice/libavdevice.v @@ -1,4 +1,4 @@ LIBAVDEVICE_$MAJOR { -global: avdevice_*; +global: avdevice_*; av_*; local: *; }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/sgidec: fix linesize for 16bit
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 27 20:48:58 2014 +0100| [ca47574e16ca6988ad7eda56d65e1d7b4fc35878] | committer: Michael Niedermayer avcodec/sgidec: fix linesize for 16bit Fixes: asan_heap-oob_22b30d4_39_038.sgi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 3b20ed85489a14cb5028c873d06960dbc5eef88a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca47574e16ca6988ad7eda56d65e1d7b4fc35878 --- libavcodec/sgidec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 6f51ec3..8338863 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -145,7 +145,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s) for (z = 0; z < s->depth; z++) { dest_row = out_buf; for (y = 0; y < s->height; y++) { -linesize = s->width * s->depth * s->bytes_per_channel; +linesize = s->width * s->depth; dest_row -= s->linesize; start_offset = bytestream2_get_be32(&g_table); bytestream2_seek(&s->g, start_offset, SEEK_SET); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] utvideoenc: properly set slice height/last line
ffmpeg | branch: release/2.4 | Christophe Gisquet | Thu Oct 9 23:27:38 2014 +0200| [f3d34cff76819fe2514323bf7da6c446b0ce81ce] | committer: Michael Niedermayer utvideoenc: properly set slice height/last line Mimic decoder and obey sampling. Does not affect fate tests for utvideo. Fixes ticket #3949. Signed-off-by: Michael Niedermayer (cherry picked from commit cb530dda7d76790b08ee3b7f67e251f3ce48c359) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3d34cff76819fe2514323bf7da6c446b0ce81ce --- libavcodec/utvideoenc.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index cbd34d0..355fdb1 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -389,7 +389,7 @@ static int write_huff_codes(uint8_t *src, uint8_t *dst, int dst_size, } static int encode_plane(AVCodecContext *avctx, uint8_t *src, -uint8_t *dst, int stride, +uint8_t *dst, int stride, int plane_no, int width, int height, PutByteContext *pb) { UtvideoContext *c= avctx->priv_data; @@ -399,6 +399,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, HuffEntry he[256]; uint32_t offset = 0, slice_len = 0; +const int cmask = ~(!plane_no && avctx->pix_fmt == AV_PIX_FMT_YUV420P); int i, sstart, send = 0; int symbol; int ret; @@ -408,7 +409,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, case PRED_NONE: for (i = 0; i < c->slices; i++) { sstart = send; -send = height * (i + 1) / c->slices; +send = height * (i + 1) / c->slices & cmask; av_image_copy_plane(dst + sstart * width, width, src + sstart * stride, stride, width, send - sstart); @@ -417,7 +418,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, case PRED_LEFT: for (i = 0; i < c->slices; i++) { sstart = send; -send = height * (i + 1) / c->slices; +send = height * (i + 1) / c->slices & cmask; left_predict(src + sstart * stride, dst + sstart * width, stride, width, send - sstart); } @@ -425,7 +426,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, case PRED_MEDIAN: for (i = 0; i < c->slices; i++) { sstart = send; -send = height * (i + 1) / c->slices; +send = height * (i + 1) / c->slices & cmask; median_predict(c, src + sstart * stride, dst + sstart * width, stride, width, send - sstart); } @@ -489,7 +490,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, send = 0; for (i = 0; i < c->slices; i++) { sstart = send; -send= height * (i + 1) / c->slices; +send= height * (i + 1) / c->slices & cmask; /* * Write the huffman codes to a buffer, @@ -571,7 +572,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_RGBA: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride, - c->slice_buffer[i], c->slice_stride, + c->slice_buffer[i], c->slice_stride, i, width, height, &pb); if (ret) { @@ -583,7 +584,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_YUV422P: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0], - pic->linesize[i], width >> !!i, height, &pb); + pic->linesize[i], i, width >> !!i, height, &pb); if (ret) { av_log(avctx, AV_LOG_ERROR, "Error encoding plane %d.\n", i); @@ -594,7 +595,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_YUV420P: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0], - pic->linesize[i], width >> !!i, height >> !!i, + pic->linesize[i], i, width >> !!i, height >> !!i, &pb); if (ret) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/hevc_ps: Check default display window bitstream and skip if invalid
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 27 14:03:09 2014 +0100| [045670a6f7e46d2ab84df0214282bbb07e0eef9c] | committer: Michael Niedermayer avcodec/hevc_ps: Check default display window bitstream and skip if invalid Fixes Ticket4035 Signed-off-by: Michael Niedermayer (cherry picked from commit 852aaead1fc294bcb63a1f9e384e781f6e51ded6) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=045670a6f7e46d2ab84df0214282bbb07e0eef9c --- libavcodec/hevc_ps.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index c17ca04..4e1c561 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -525,7 +525,11 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps) vui->field_seq_flag= get_bits1(gb); vui->frame_field_info_present_flag = get_bits1(gb); -vui->default_display_window_flag = get_bits1(gb); +if (get_bits_left(gb) >= 68 && show_bits_long(gb, 21) == 0x10) { +vui->default_display_window_flag = 0; +av_log(s->avctx, AV_LOG_WARNING, "Invalid default display window\n"); +} else +vui->default_display_window_flag = get_bits1(gb); // Backup context in case an alternate header is detected memcpy(&backup, gb, sizeof(backup)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/g2meet: check tile dimensions to avoid integer overflow
ffmpeg | branch: release/2.4 | Michael Niedermayer | Thu Oct 30 01:19:17 2014 +0100| [1f636a697f6bfe45e97d072fdd27021df8ea61d5] | committer: Michael Niedermayer avcodec/g2meet: check tile dimensions to avoid integer overflow Fixes out of array access Fixes: asan_heap-oob_12a55d3_30_029.wmv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 32e666c354e4a3160d8cf1d303cb51990b095c87) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f636a697f6bfe45e97d072fdd27021df8ea61d5 --- libavcodec/g2meet.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 1004e19..d0cb88c 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -736,8 +736,10 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, } c->tile_width = bytestream2_get_be32(&bc); c->tile_height = bytestream2_get_be32(&bc); -if (!c->tile_width || !c->tile_height || -((c->tile_width | c->tile_height) & 0xF)) { +if (c->tile_width <= 0 || c->tile_height <= 0 || +((c->tile_width | c->tile_height) & 0xF) || +c->tile_width * 4LL * c->tile_height >= INT_MAX +) { av_log(avctx, AV_LOG_ERROR, "Invalid tile dimensions %dx%d\n", c->tile_width, c->tile_height); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dxa: check dimensions
ffmpeg | branch: release/2.4 | Michael Niedermayer | Tue Oct 28 15:26:42 2014 +0100| [c7b7e0790c7bf2c799a4f07ae9f54f36c910323d] | committer: Michael Niedermayer avcodec/dxa: check dimensions Fixes out of array access Fixes: asan_heap-oob_11222fb_21_020.dxa Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c7b7e0790c7bf2c799a4f07ae9f54f36c910323d --- libavcodec/dxa.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 0f64b5e..c8e3f71 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx) { DxaDecContext * const c = avctx->priv_data; +if (avctx->width%4 || avctx->height%4) { +avpriv_request_sample(avctx, "dimensions are not a multiple of 4"); +return AVERROR_INVALIDDATA; +} + c->prev = av_frame_alloc(); if (!c->prev) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dnxhddec: treat pix_fmt like width/height
ffmpeg | branch: release/2.4 | Michael Niedermayer | Wed Oct 29 00:57:07 2014 +0100| [66fcf1fa404ea4b32ed02f6cd9ca1b057ae4fc6c] | committer: Michael Niedermayer avcodec/dnxhddec: treat pix_fmt like width/height Fixes out of array accesses Fixes: asan_heap-oob_22c9a39_16_015.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit f3c0e0bf6f53df0977f3878d4f5cec99dff8de9e) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66fcf1fa404ea4b32ed02f6cd9ca1b057ae4fc6c --- libavcodec/dnxhddec.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 787c6c5..0680074 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -38,6 +38,7 @@ typedef struct DNXHDContext { BlockDSPContext bdsp; int64_t cid;///< compression id unsigned int width, height; +enum AVPixelFormat pix_fmt; unsigned int mb_width, mb_height; uint32_t mb_scan_index[68]; /* max for 1080p */ int cur_field; ///< current interlaced field @@ -141,7 +142,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->is_444 = 0; if (buf[0x4] == 0x2) { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10; +ctx->pix_fmt = AV_PIX_FMT_YUV444P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { ff_blockdsp_init(&ctx->bdsp, ctx->avctx); @@ -151,7 +152,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, } ctx->is_444 = 1; } else if (buf[0x21] & 0x40) { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10; +ctx->pix_fmt = AV_PIX_FMT_YUV422P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { ff_blockdsp_init(&ctx->bdsp, ctx->avctx); @@ -160,7 +161,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->decode_dct_block = dnxhd_decode_dct_block_10; } } else { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P; +ctx->pix_fmt = AV_PIX_FMT_YUV422P; ctx->avctx->bits_per_raw_sample = 8; if (ctx->bit_depth != 8) { ff_blockdsp_init(&ctx->bdsp, ctx->avctx); @@ -446,7 +447,13 @@ decode_coding_unit: avctx->width, avctx->height, ctx->width, ctx->height); first_field = 1; } +if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) { +av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n", + av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt)); +first_field = 1; +} +avctx->pix_fmt = ctx->pix_fmt; ret = ff_set_dimensions(avctx, ctx->width, ctx->height); if (ret < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
ffmpeg | branch: release/2.4 | Michael Niedermayer | Tue Oct 28 01:23:40 2014 +0100| [8e95ddbe82c4bb50e117e791b1b45edfd1b764dd] | committer: Michael Niedermayer avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y Fixes very long but finite loop Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 5145d22b88b9835db81c4d286b931a78e08ab76a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e95ddbe82c4bb50e117e791b1b45edfd1b764dd --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 0511f1c..aa8e2b0 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1004,8 +1004,8 @@ static int dirac_unpack_idwt_params(DiracContext *s) /* Codeblock parameters (core syntax only) */ if (get_bits1(gb)) { for (i = 0; i <= s->wavelet_depth; i++) { -CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n") -CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n") +CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n") +CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n") } CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n") ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/sgidec: fix count check
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 27 20:48:58 2014 +0100| [73c6520c096b017e0a464718fee683abae4c5d2c] | committer: Michael Niedermayer avcodec/sgidec: fix count check Fixes: asan_heap-oob_22b30d4_39_038.sgi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit a050cf0c451bdf1c1bd512c4fce6b6f8a5e85102) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=73c6520c096b017e0a464718fee683abae4c5d2c --- libavcodec/sgidec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 8338863..3ddbf77 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -98,7 +98,7 @@ static int expand_rle_row16(SgiState *s, uint16_t *out_buf, break; /* Check for buffer overflow. */ -if (pixelstride * (count - 1) >= len) { +if (out_end - out_buf <= pixelstride * (count - 1)) { av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n"); return AVERROR_INVALIDDATA; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/tiffenc: properly compute packet size
ffmpeg | branch: release/2.4 | Christophe Gisquet | Sun Oct 12 21:10:54 2014 +0200| [30a0622a5dbf2753553deddbfbf2410f7d7799e6] | committer: Michael Niedermayer avcodec/tiffenc: properly compute packet size The bytes per row is a better indication of it. Helps resolving ticket #3874 by fixing ffmpeg's encoder and transforming the issue in a issue with non-compliant decoders. ffmpeg's one is ok, but unfortunately, many others aren't handling correctly unusual chroma samplings. Signed-off-by: Michael Niedermayer (cherry picked from commit 0e8bfd3c934768f9812dd20d71fa4709de54186d) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30a0622a5dbf2753553deddbfbf2410f7d7799e6 --- libavcodec/tiffenc.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 5a61f1a..138d214 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -305,7 +305,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, strips = (s->height - 1) / s->rps + 1; -packet_size = avctx->height * ((avctx->width * s->bpp + 7) >> 3) * 2 + +bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp * + s->subsampling[0] * s->subsampling[1] + 7) >> 3; +packet_size = avctx->height * bytes_per_row * 2 + avctx->height * 4 + FF_MIN_BUFFER_SIZE; if ((ret = ff_alloc_packet2(avctx, pkt, packet_size)) < 0) @@ -333,8 +335,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, goto fail; } -bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp * - s->subsampling[0] * s->subsampling[1] + 7) >> 3; if (is_yuv) { av_fast_padded_malloc(&s->yuv_line, &s->yuv_line_size, bytes_per_row); if (s->yuv_line == NULL) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
ffmpeg | branch: release/2.4 | Michael Niedermayer | Tue Oct 28 01:23:40 2014 +0100| [8cba067fe52a717bdd2d3ed16c5c06bce54fa7a0] | committer: Michael Niedermayer avcodec/diracdec: Use 64bit in calculation of codeblock coordinates Fixes integer overflow Fixes out of array read Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cba067fe52a717bdd2d3ed16c5c06bce54fa7a0 --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index c03f45c..0511f1c 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -612,10 +612,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b top = 0; for (cb_y = 0; cb_y < cb_height; cb_y++) { -bottom = (b->height * (cb_y+1)) / cb_height; +bottom = (b->height * (cb_y+1LL)) / cb_height; left = 0; for (cb_x = 0; cb_x < cb_width; cb_x++) { -right = (b->width * (cb_x+1)) / cb_width; +right = (b->width * (cb_x+1LL)) / cb_width; codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith); left = right; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
ffmpeg | branch: release/2.4 | Michael Niedermayer | Wed Oct 29 14:15:29 2014 +0100| [24d725f455742378048e6a7e41dd21ec8df893e2] | committer: Michael Niedermayer avcodec/utils: Align dimensions by at least their chroma sub-sampling factors. Fixes: out of array accesses Fixes: asan_heap-oob_112c6b3_13_012.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit df74811cd53e45fcbbd3b77a1c42416816687c5c) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24d725f455742378048e6a7e41dd21ec8df893e2 --- libavcodec/utils.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 07874c2..4931444 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -279,6 +279,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int i; int w_align = 1; int h_align = 1; +AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt); + +if (desc) { +w_align = 1 << desc->log2_chroma_w; +h_align = 1 << desc->log2_chroma_h; +} switch (s->pix_fmt) { case AV_PIX_FMT_YUV420P: @@ -406,8 +412,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, } break; default: -w_align = 1; -h_align = 1; break; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mxfdec: Fix termination of mxf_data_essence_container_uls
ffmpeg | branch: release/2.4 | Michael Niedermayer | Wed Oct 15 01:36:04 2014 +0200| [2185103bcdd24c674d1e9648edd701a6a7a6fe60] | committer: Michael Niedermayer avformat/mxfdec: Fix termination of mxf_data_essence_container_uls Fixes: asan_static-oob_87d116_10_201.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e3b28f10bb9b6750c97ee282a7e656d60d6d9e34) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2185103bcdd24c674d1e9648edd701a6a7a6fe60 --- libavformat/mxfdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 7a4633f..1dcdae0 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -988,7 +988,7 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] = { static const MXFCodecUL mxf_data_essence_container_uls[] = { { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 }, -{ { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE }, +{ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_CODEC_ID_NONE }, }; static const char* const mxf_data_essence_descriptor[] = { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/svq1dec: zero terminate embedded message before printing
ffmpeg | branch: release/2.4 | Michael Niedermayer | Thu Oct 30 18:16:25 2014 +0100| [63523485f4d312f9d98eb30dfa633a9f75671b7e] | committer: Michael Niedermayer avcodec/svq1dec: zero terminate embedded message before printing Fixes out of array access Fixes: asan_stack-oob_49b1e5_10_009.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e91ba2efa949470e9157b652535d207a101f91e0) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63523485f4d312f9d98eb30dfa633a9f75671b7e --- libavcodec/svq1dec.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 121ebc4..052b618 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -499,7 +499,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp, return result; } -static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out) +static void svq1_parse_string(GetBitContext *bitbuf, uint8_t out[257]) { uint8_t seed; int i; @@ -511,6 +511,7 @@ static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out) out[i] = get_bits(bitbuf, 8) ^ seed; seed = string_table[out[i] ^ seed]; } +out[i] = 0; } static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) @@ -553,12 +554,12 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) } if ((s->frame_code ^ 0x10) >= 0x50) { -uint8_t msg[256]; +uint8_t msg[257]; svq1_parse_string(bitbuf, msg); av_log(avctx, AV_LOG_INFO, - "embedded message:\n%s\n", (char *)msg); + "embedded message:\n%s\n", ((char *)msg) + 1); } skip_bits(bitbuf, 2); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dirac_arith: fix integer overflow
ffmpeg | branch: release/2.4 | Michael Niedermayer | Tue Oct 28 02:14:41 2014 +0100| [3f3e5f8f60ef2ed221b17bc72c989921dba6d9a5] | committer: Michael Niedermayer avcodec/dirac_arith: fix integer overflow Fixes: asan_heap-oob_1078676_9_008.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 39680caceebfc6abf09b17032048752c014e57a8) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f3e5f8f60ef2ed221b17bc72c989921dba6d9a5 --- libavcodec/dirac_arith.h |4 1 file changed, 4 insertions(+) diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h index 089c71a..a1fa96b 100644 --- a/libavcodec/dirac_arith.h +++ b/libavcodec/dirac_arith.h @@ -171,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c { int ret = 1; while (!dirac_get_arith_bit(c, follow_ctx)) { +if (ret >= 0x4000) { +av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n"); +return -1; +} ret <<= 1; ret += dirac_get_arith_bit(c, data_ctx); follow_ctx = ff_dirac_next_ctx[follow_ctx]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc/postprocess: fix quant store for fq mode
ffmpeg | branch: release/2.4 | Michael Niedermayer | Sun Oct 12 20:26:27 2014 +0200| [5a1efc7b8585da037d8c603cf6d1c38d5b9a4cf9] | committer: Michael Niedermayer postproc/postprocess: fix quant store for fq mode Signed-off-by: Michael Niedermayer (cherry picked from commit 941aaa39e8cd78ba4d16dfcec767290aec9a0136) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a1efc7b8585da037d8c603cf6d1c38d5b9a4cf9 --- libpostproc/postprocess.c |2 +- tests/ref/fate/filter-pp3 |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 01ec0f9..ab12e59 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -1004,7 +1004,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if((pict_type&7)!=3){ if (QPStride >= 0){ int i; -const int count= mbHeight * QPStride; +const int count= mbHeight * FFMAX(QPStride, mbWidth); for(i=0; i<(count>>2); i++){ ((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F; } diff --git a/tests/ref/fate/filter-pp3 b/tests/ref/fate/filter-pp3 index 00d4595..c2f2b4c 100644 --- a/tests/ref/fate/filter-pp3 +++ b/tests/ref/fate/filter-pp3 @@ -1 +1 @@ -pp3 f38fdc2dfa4c8d889918efe6d7a7ac3a +pp3 ef0f10f1859af2f75717e8c9d64ee38a ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swresample/swresample: fix sample drop loop end condition
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 6 01:08:20 2014 +0200| [81b38caf21fc7e568ec0a874b9921c3c75cd460c] | committer: Michael Niedermayer swresample/swresample: fix sample drop loop end condition Fixes Ticket3985 Signed-off-by: Michael Niedermayer (cherry picked from commit f9fefa499f0af48f47ea73c8ce0b25df0976c315) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81b38caf21fc7e568ec0a874b9921c3c75cd460c --- libswresample/swresample.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 32bbee3..c325513 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -663,6 +663,8 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun in_count = 0; if(ret>0) { s->drop_output -= ret; +if (!s->drop_output && !out_arg) +return 0; continue; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/cook: check that the subpacket sizes fit in block_align
ffmpeg | branch: release/2.4 | Michael Niedermayer | Thu Oct 30 16:53:09 2014 +0100| [35bc67503e802289d69938953ec7a328dd0eab6a] | committer: Michael Niedermayer avcodec/cook: check that the subpacket sizes fit in block_align Fixes out of array read Fixes: asan_heap-oob_fb5c50_19_018.rmvb Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 10e32618acce9c3fc64c061eb7907e8a8d2749ae) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=35bc67503e802289d69938953ec7a328dd0eab6a --- libavcodec/cook.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index eb2654e..0cc01d0 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1215,8 +1215,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) q->num_subpackets++; s++; -if (s > MAX_SUBPACKETS) { -avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS); +if (s > FFMIN(MAX_SUBPACKETS, avctx->block_align)) { +avpriv_request_sample(avctx, "subpackets > %d", FFMIN(MAX_SUBPACKETS, avctx->block_align)); return AVERROR_PATCHWELCOME; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Update for 2.4.3
ffmpeg | branch: release/2.4 | Michael Niedermayer | Sat Nov 1 13:39:52 2014 +0100| [04aa2ffbcf706605499ebd1ab063e782d9f7] | committer: Michael Niedermayer Update for 2.4.3 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=04aa2ffbcf706605499ebd1ab063e782d9f7 --- Changelog| 26 ++ RELEASE |2 +- doc/Doxyfile |2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 8a6826a..1002a0f 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,32 @@ releases are sorted from youngest to oldest. version : +version 2.4.3: +- avcodec/svq1dec: zero terminate embedded message before printing +- avcodec/cook: check that the subpacket sizes fit in block_align +- avcodec/g2meet: check tile dimensions to avoid integer overflow +- avcodec/utils: Align dimensions by at least their chroma sub-sampling factors. +- avcodec/dnxhddec: treat pix_fmt like width/height +- avcodec/dxa: check dimensions +- avcodec/dirac_arith: fix integer overflow +- avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y +- avcodec/diracdec: Use 64bit in calculation of codeblock coordinates +- avcodec/sgidec: fix count check +- avcodec/sgidec: fix linesize for 16bit +- avcodec/hevc_ps: Check default display window bitstream and skip if invalid +- avcodec/tiffenc: properly compute packet size +- lavd: export all symbols with av_ prefix +- avformat/mxfdec: Fix termination of mxf_data_essence_container_uls +- postproc: fix qp count +- postproc/postprocess: fix quant store for fq mode +- vf_drawtext: add missing clear of pointers after av_expr_free() +- utvideoenc: properly set slice height/last line +- swresample: fix sample drop loop end condition +- resample: Avoid off-by-1 errors in PTS calcs. +- imc: fix order of operations in coefficients read +- hevc_mvs: make sure to always initialize the temporal MV fully +- hevc_mvs: initialize the temporal MV in case of missing reference + version 2.4.2: - avcodec/on2avc: Check number of channels - avcodec/hevc: fix chroma transform_add size diff --git a/RELEASE b/RELEASE index 8e8299d..35cee72 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -2.4.2 +2.4.3 diff --git a/doc/Doxyfile b/doc/Doxyfile index 897859a..e158951 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.4.2 +PROJECT_NUMBER = 2.4.3 # With the PROJECT_LOGO tag one can specify a logo or icon that is included # in the documentation. The maximum height of the logo should not exceed 55 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/sgidec: fix linesize for 16bit
ffmpeg | branch: release/2.3 | Michael Niedermayer | Mon Oct 27 20:48:58 2014 +0100| [4a03c31728c833f8d4a959f6de4837234560ca3d] | committer: Michael Niedermayer avcodec/sgidec: fix linesize for 16bit Fixes: asan_heap-oob_22b30d4_39_038.sgi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 3b20ed85489a14cb5028c873d06960dbc5eef88a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a03c31728c833f8d4a959f6de4837234560ca3d --- libavcodec/sgidec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 6f51ec3..8338863 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -145,7 +145,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s) for (z = 0; z < s->depth; z++) { dest_row = out_buf; for (y = 0; y < s->height; y++) { -linesize = s->width * s->depth * s->bytes_per_channel; +linesize = s->width * s->depth; dest_row -= s->linesize; start_offset = bytestream2_get_be32(&g_table); bytestream2_seek(&s->g, start_offset, SEEK_SET); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
ffmpeg | branch: release/2.3 | Michael Niedermayer | Wed Oct 29 14:15:29 2014 +0100| [0db579445f5201fe2a341ae6485ac51668254fe7] | committer: Michael Niedermayer avcodec/utils: Align dimensions by at least their chroma sub-sampling factors. Fixes: out of array accesses Fixes: asan_heap-oob_112c6b3_13_012.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit df74811cd53e45fcbbd3b77a1c42416816687c5c) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0db579445f5201fe2a341ae6485ac51668254fe7 --- libavcodec/utils.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index cb51e48..8919e15 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -297,6 +297,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int i; int w_align = 1; int h_align = 1; +AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt); + +if (desc) { +w_align = 1 << desc->log2_chroma_w; +h_align = 1 << desc->log2_chroma_h; +} switch (s->pix_fmt) { case AV_PIX_FMT_YUV420P: @@ -424,8 +430,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, } break; default: -w_align = 1; -h_align = 1; break; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/tiffenc: properly compute packet size
ffmpeg | branch: release/2.3 | Christophe Gisquet | Sun Oct 12 21:10:54 2014 +0200| [c3c8857263d4e607b3ae6323f87f484c76b5e53f] | committer: Michael Niedermayer avcodec/tiffenc: properly compute packet size The bytes per row is a better indication of it. Helps resolving ticket #3874 by fixing ffmpeg's encoder and transforming the issue in a issue with non-compliant decoders. ffmpeg's one is ok, but unfortunately, many others aren't handling correctly unusual chroma samplings. Signed-off-by: Michael Niedermayer (cherry picked from commit 0e8bfd3c934768f9812dd20d71fa4709de54186d) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c3c8857263d4e607b3ae6323f87f484c76b5e53f --- libavcodec/tiffenc.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 5a61f1a..138d214 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -305,7 +305,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, strips = (s->height - 1) / s->rps + 1; -packet_size = avctx->height * ((avctx->width * s->bpp + 7) >> 3) * 2 + +bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp * + s->subsampling[0] * s->subsampling[1] + 7) >> 3; +packet_size = avctx->height * bytes_per_row * 2 + avctx->height * 4 + FF_MIN_BUFFER_SIZE; if ((ret = ff_alloc_packet2(avctx, pkt, packet_size)) < 0) @@ -333,8 +335,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, goto fail; } -bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp * - s->subsampling[0] * s->subsampling[1] + 7) >> 3; if (is_yuv) { av_fast_padded_malloc(&s->yuv_line, &s->yuv_line_size, bytes_per_row); if (s->yuv_line == NULL) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
ffmpeg | branch: release/2.3 | Michael Niedermayer | Tue Oct 28 01:23:40 2014 +0100| [1ec6a3c768b28296022dd5eee08863a313ff1acb] | committer: Michael Niedermayer avcodec/diracdec: Use 64bit in calculation of codeblock coordinates Fixes integer overflow Fixes out of array read Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ec6a3c768b28296022dd5eee08863a313ff1acb --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index a18c867..a7ace3c 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -611,10 +611,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b top = 0; for (cb_y = 0; cb_y < cb_height; cb_y++) { -bottom = (b->height * (cb_y+1)) / cb_height; +bottom = (b->height * (cb_y+1LL)) / cb_height; left = 0; for (cb_x = 0; cb_x < cb_width; cb_x++) { -right = (b->width * (cb_x+1)) / cb_width; +right = (b->width * (cb_x+1LL)) / cb_width; codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith); left = right; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/svq1dec: zero terminate embedded message before printing
ffmpeg | branch: release/2.3 | Michael Niedermayer | Thu Oct 30 18:16:25 2014 +0100| [9395a3a96bf82038d0cad65b7fb4b9d873836ae7] | committer: Michael Niedermayer avcodec/svq1dec: zero terminate embedded message before printing Fixes out of array access Fixes: asan_stack-oob_49b1e5_10_009.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e91ba2efa949470e9157b652535d207a101f91e0) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9395a3a96bf82038d0cad65b7fb4b9d873836ae7 --- libavcodec/svq1dec.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 1e7ab49..8ac7885 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -495,7 +495,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp, return result; } -static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out) +static void svq1_parse_string(GetBitContext *bitbuf, uint8_t out[257]) { uint8_t seed; int i; @@ -507,6 +507,7 @@ static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out) out[i] = get_bits(bitbuf, 8) ^ seed; seed = string_table[out[i] ^ seed]; } +out[i] = 0; } static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) @@ -549,12 +550,12 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) } if ((s->frame_code ^ 0x10) >= 0x50) { -uint8_t msg[256]; +uint8_t msg[257]; svq1_parse_string(bitbuf, msg); av_log(avctx, AV_LOG_INFO, - "embedded message:\n%s\n", (char *)msg); + "embedded message:\n%s\n", ((char *)msg) + 1); } skip_bits(bitbuf, 2); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dxa: check dimensions
ffmpeg | branch: release/2.3 | Michael Niedermayer | Tue Oct 28 15:26:42 2014 +0100| [7b7d12ea0448c8418ab086ec8f202a5fb14f54fe] | committer: Michael Niedermayer avcodec/dxa: check dimensions Fixes out of array access Fixes: asan_heap-oob_11222fb_21_020.dxa Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b7d12ea0448c8418ab086ec8f202a5fb14f54fe --- libavcodec/dxa.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 0f64b5e..c8e3f71 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx) { DxaDecContext * const c = avctx->priv_data; +if (avctx->width%4 || avctx->height%4) { +avpriv_request_sample(avctx, "dimensions are not a multiple of 4"); +return AVERROR_INVALIDDATA; +} + c->prev = av_frame_alloc(); if (!c->prev) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dirac_arith: fix integer overflow
ffmpeg | branch: release/2.3 | Michael Niedermayer | Tue Oct 28 02:14:41 2014 +0100| [e26fd791efaa52f825903be6e41d44fbaf40aadb] | committer: Michael Niedermayer avcodec/dirac_arith: fix integer overflow Fixes: asan_heap-oob_1078676_9_008.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 39680caceebfc6abf09b17032048752c014e57a8) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e26fd791efaa52f825903be6e41d44fbaf40aadb --- libavcodec/dirac_arith.h |4 1 file changed, 4 insertions(+) diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h index 089c71a..a1fa96b 100644 --- a/libavcodec/dirac_arith.h +++ b/libavcodec/dirac_arith.h @@ -171,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c { int ret = 1; while (!dirac_get_arith_bit(c, follow_ctx)) { +if (ret >= 0x4000) { +av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n"); +return -1; +} ret <<= 1; ret += dirac_get_arith_bit(c, data_ctx); follow_ctx = ff_dirac_next_ctx[follow_ctx]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] update for 2.3.5
ffmpeg | branch: release/2.3 | Michael Niedermayer | Sat Nov 1 14:30:10 2014 +0100| [b44506c393b176dc396502ad262ac18bec52a110] | committer: Michael Niedermayer update for 2.3.5 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b44506c393b176dc396502ad262ac18bec52a110 --- RELEASE |2 +- doc/Doxyfile |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE b/RELEASE index 3f684d2..cc6c9a4 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -2.3.4 +2.3.5 diff --git a/doc/Doxyfile b/doc/Doxyfile index 5ded0c6..c4f0236 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.3.4 +PROJECT_NUMBER = 2.3.5 # With the PROJECT_LOGO tag one can specify a logo or icon that is included # in the documentation. The maximum height of the logo should not exceed 55 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
ffmpeg | branch: release/2.3 | Michael Niedermayer | Tue Oct 28 01:23:40 2014 +0100| [ad98b2891cea0276323ae1769ba6a6128855c316] | committer: Michael Niedermayer avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y Fixes very long but finite loop Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 5145d22b88b9835db81c4d286b931a78e08ab76a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad98b2891cea0276323ae1769ba6a6128855c316 --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index a7ace3c..806ff82 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1003,8 +1003,8 @@ static int dirac_unpack_idwt_params(DiracContext *s) /* Codeblock parameters (core syntax only) */ if (get_bits1(gb)) { for (i = 0; i <= s->wavelet_depth; i++) { -CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n") -CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n") +CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n") +CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n") } CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n") ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/cook: check that the subpacket sizes fit in block_align
ffmpeg | branch: release/2.3 | Michael Niedermayer | Thu Oct 30 16:53:09 2014 +0100| [25d2a4dde7240e05f5098c6d50ae3d534463dd79] | committer: Michael Niedermayer avcodec/cook: check that the subpacket sizes fit in block_align Fixes out of array read Fixes: asan_heap-oob_fb5c50_19_018.rmvb Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 10e32618acce9c3fc64c061eb7907e8a8d2749ae) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25d2a4dde7240e05f5098c6d50ae3d534463dd79 --- libavcodec/cook.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 5860288..4f83c9d 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1215,8 +1215,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) q->num_subpackets++; s++; -if (s > MAX_SUBPACKETS) { -avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS); +if (s > FFMIN(MAX_SUBPACKETS, avctx->block_align)) { +avpriv_request_sample(avctx, "subpackets > %d", FFMIN(MAX_SUBPACKETS, avctx->block_align)); return AVERROR_PATCHWELCOME; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/g2meet: check tile dimensions to avoid integer overflow
ffmpeg | branch: release/2.3 | Michael Niedermayer | Thu Oct 30 01:19:17 2014 +0100| [bfee1e90725aa2b832a0fd7bbd0393c9c23e7f0a] | committer: Michael Niedermayer avcodec/g2meet: check tile dimensions to avoid integer overflow Fixes out of array access Fixes: asan_heap-oob_12a55d3_30_029.wmv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 32e666c354e4a3160d8cf1d303cb51990b095c87) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfee1e90725aa2b832a0fd7bbd0393c9c23e7f0a --- libavcodec/g2meet.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 1004e19..d0cb88c 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -736,8 +736,10 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, } c->tile_width = bytestream2_get_be32(&bc); c->tile_height = bytestream2_get_be32(&bc); -if (!c->tile_width || !c->tile_height || -((c->tile_width | c->tile_height) & 0xF)) { +if (c->tile_width <= 0 || c->tile_height <= 0 || +((c->tile_width | c->tile_height) & 0xF) || +c->tile_width * 4LL * c->tile_height >= INT_MAX +) { av_log(avctx, AV_LOG_ERROR, "Invalid tile dimensions %dx%d\n", c->tile_width, c->tile_height); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/sgidec: fix count check
ffmpeg | branch: release/2.3 | Michael Niedermayer | Mon Oct 27 20:48:58 2014 +0100| [5c791b1c9ce0edab69d4aa9b17a967a3b3792a07] | committer: Michael Niedermayer avcodec/sgidec: fix count check Fixes: asan_heap-oob_22b30d4_39_038.sgi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit a050cf0c451bdf1c1bd512c4fce6b6f8a5e85102) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c791b1c9ce0edab69d4aa9b17a967a3b3792a07 --- libavcodec/sgidec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 8338863..3ddbf77 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -98,7 +98,7 @@ static int expand_rle_row16(SgiState *s, uint16_t *out_buf, break; /* Check for buffer overflow. */ -if (pixelstride * (count - 1) >= len) { +if (out_end - out_buf <= pixelstride * (count - 1)) { av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n"); return AVERROR_INVALIDDATA; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dnxhddec: treat pix_fmt like width/height
ffmpeg | branch: release/2.3 | Michael Niedermayer | Wed Oct 29 00:57:07 2014 +0100| [e3275571c7e27f62eec6ce5b4945c612b1b649b8] | committer: Michael Niedermayer avcodec/dnxhddec: treat pix_fmt like width/height Fixes out of array accesses Fixes: asan_heap-oob_22c9a39_16_015.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit f3c0e0bf6f53df0977f3878d4f5cec99dff8de9e) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e3275571c7e27f62eec6ce5b4945c612b1b649b8 --- libavcodec/dnxhddec.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 787c6c5..0680074 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -38,6 +38,7 @@ typedef struct DNXHDContext { BlockDSPContext bdsp; int64_t cid;///< compression id unsigned int width, height; +enum AVPixelFormat pix_fmt; unsigned int mb_width, mb_height; uint32_t mb_scan_index[68]; /* max for 1080p */ int cur_field; ///< current interlaced field @@ -141,7 +142,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->is_444 = 0; if (buf[0x4] == 0x2) { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10; +ctx->pix_fmt = AV_PIX_FMT_YUV444P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { ff_blockdsp_init(&ctx->bdsp, ctx->avctx); @@ -151,7 +152,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, } ctx->is_444 = 1; } else if (buf[0x21] & 0x40) { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10; +ctx->pix_fmt = AV_PIX_FMT_YUV422P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { ff_blockdsp_init(&ctx->bdsp, ctx->avctx); @@ -160,7 +161,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->decode_dct_block = dnxhd_decode_dct_block_10; } } else { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P; +ctx->pix_fmt = AV_PIX_FMT_YUV422P; ctx->avctx->bits_per_raw_sample = 8; if (ctx->bit_depth != 8) { ff_blockdsp_init(&ctx->bdsp, ctx->avctx); @@ -446,7 +447,13 @@ decode_coding_unit: avctx->width, avctx->height, ctx->width, ctx->height); first_field = 1; } +if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) { +av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n", + av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt)); +first_field = 1; +} +avctx->pix_fmt = ctx->pix_fmt; ret = ff_set_dimensions(avctx, ctx->width, ctx->height); if (ret < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Tag n2.3.5 : FFmpeg 2.3.5 release
[ffmpeg] [branch: refs/tags/n2.3.5] Tag:f781ccd986e3fb2dba2e717ed8584c5f0b5032d4 > http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=f781ccd986e3fb2dba2e717ed8584c5f0b5032d4 Tagger: Michael Niedermayer Date: Sat Nov 1 14:46:39 2014 +0100 FFmpeg 2.3.5 release ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 148ee69 web/olddownload: add FFmpeg 2.3.5
The branch, master has been updated via 148ee69684b6ebc069bafde99a3034406c7ebe1a (commit) from 2e49c7286d0185edd44ea8be92df2c7fe99f1f80 (commit) - Log - commit 148ee69684b6ebc069bafde99a3034406c7ebe1a Author: Michael Niedermayer AuthorDate: Sat Nov 1 14:49:34 2014 +0100 Commit: Michael Niedermayer CommitDate: Sat Nov 1 14:49:34 2014 +0100 web/olddownload: add FFmpeg 2.3.5 diff --git a/src/olddownload b/src/olddownload index 14bb51e..c6d0c12 100644 --- a/src/olddownload +++ b/src/olddownload @@ -6,10 +6,10 @@ maintaining an old release. -FFmpeg 2.3.4 "Mandelbrot" +FFmpeg 2.3.5 "Mandelbrot" -2.3.4 was released on 2014-10-03. It is the latest stable FFmpeg release +2.3.5 was released on 2014-11-01. It is the latest stable FFmpeg release from the 2.3 release branch, which was cut from master on 2014-07-16. Amongst lots of other changes, it includes all changes from ffmpeg-mt, libav master of 2014-07-15, libav 10.2 as of 2014-07-15. @@ -29,15 +29,15 @@ libpostproc52. 3.100 - Download bzip2 tarball - PGP signature + Download bzip2 tarball + PGP signature - Download gzip tarball - PGP signature + Download gzip tarball + PGP signature - http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n2.3.4";>Changelog + http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n2.3.5";>Changelog http://git.videolan.org/?p=ffmpeg.git;a=blob;f=RELEASE_NOTES;hb=489d066";>Release Notes --- Summary of changes: src/olddownload | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) hooks/post-receive -- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] h264: Always invoke the get_format() callback
ffmpeg | branch: release/2.2 | Rémi Denis-Courmont | Thu Sep 25 11:59:57 2014 +0300| [c7caed88a03567e8777a606f4bd42f093c6b302c] | committer: Luca Barbato h264: Always invoke the get_format() callback Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c7caed88a03567e8777a606f4bd42f093c6b302c --- libavcodec/h264.c | 51 +++ 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index aee8db0..7e62881 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3083,45 +3083,54 @@ static int h264_set_parameter_from_sps(H264Context *h) static enum AVPixelFormat get_pixel_format(H264Context *h) { +enum AVPixelFormat pix_fmts[2]; +const enum AVPixelFormat *choices = pix_fmts; + +pix_fmts[1] = AV_PIX_FMT_NONE; + switch (h->sps.bit_depth_luma) { case 9: if (CHROMA444(h)) { if (h->avctx->colorspace == AVCOL_SPC_RGB) { -return AV_PIX_FMT_GBRP9; +pix_fmts[0] = AV_PIX_FMT_GBRP9; } else -return AV_PIX_FMT_YUV444P9; +pix_fmts[0] = AV_PIX_FMT_YUV444P9; } else if (CHROMA422(h)) -return AV_PIX_FMT_YUV422P9; +pix_fmts[0] = AV_PIX_FMT_YUV422P9; else -return AV_PIX_FMT_YUV420P9; +pix_fmts[0] = AV_PIX_FMT_YUV420P9; break; case 10: if (CHROMA444(h)) { if (h->avctx->colorspace == AVCOL_SPC_RGB) { -return AV_PIX_FMT_GBRP10; +pix_fmts[0] = AV_PIX_FMT_GBRP10; } else -return AV_PIX_FMT_YUV444P10; +pix_fmts[0] = AV_PIX_FMT_YUV444P10; } else if (CHROMA422(h)) -return AV_PIX_FMT_YUV422P10; +pix_fmts[0] = AV_PIX_FMT_YUV422P10; else -return AV_PIX_FMT_YUV420P10; +pix_fmts[0] = AV_PIX_FMT_YUV420P10; break; case 8: if (CHROMA444(h)) { -if (h->avctx->colorspace == AVCOL_SPC_RGB) { -return AV_PIX_FMT_GBRP; -} else -return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P - : AV_PIX_FMT_YUV444P; +if (h->avctx->colorspace == AVCOL_SPC_RGB) +pix_fmts[0] = AV_PIX_FMT_GBRP; +else if (h->avctx->color_range == AVCOL_RANGE_JPEG) +pix_fmts[0] = AV_PIX_FMT_YUVJ444P; +else +pix_fmts[0] = AV_PIX_FMT_YUV444P; } else if (CHROMA422(h)) { -return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P - : AV_PIX_FMT_YUV422P; +if (h->avctx->color_range == AVCOL_RANGE_JPEG) +pix_fmts[0] = AV_PIX_FMT_YUVJ422P; +else +pix_fmts[0] = AV_PIX_FMT_YUV422P; } else { -return h->avctx->get_format(h->avctx, h->avctx->codec->pix_fmts ? -h->avctx->codec->pix_fmts : -h->avctx->color_range == AVCOL_RANGE_JPEG ? -h264_hwaccel_pixfmt_list_jpeg_420 : -h264_hwaccel_pixfmt_list_420); +if (h->avctx->codec->pix_fmts) +choices = h->avctx->codec->pix_fmts; +else if (h->avctx->color_range == AVCOL_RANGE_JPEG) +choices = h264_hwaccel_pixfmt_list_jpeg_420; +else +choices = h264_hwaccel_pixfmt_list_420; } break; default: @@ -3129,6 +3138,8 @@ static enum AVPixelFormat get_pixel_format(H264Context *h) "Unsupported bit depth %d\n", h->sps.bit_depth_luma); return AVERROR_INVALIDDATA; } + +return h->avctx->get_format(h->avctx, choices); } /* export coded and cropped frame dimensions to AVCodecContext */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'c7caed88a03567e8777a606f4bd42f093c6b302c' into release/2.2
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sat Nov 1 15:08:51 2014 +0100| [2d1d053c5d2ca59c8c0f35d91404cd899267add1] | committer: Michael Niedermayer Merge commit 'c7caed88a03567e8777a606f4bd42f093c6b302c' into release/2.2 * commit 'c7caed88a03567e8777a606f4bd42f093c6b302c': h264: Always invoke the get_format() callback Conflicts: libavcodec/h264.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d1d053c5d2ca59c8c0f35d91404cd899267add1 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] imc: fix order of operations in coefficients read
ffmpeg | branch: release/2.2 | Vittorio Giovara | Mon Oct 13 15:42:28 2014 +0100| [787a6156a2d887bb1d65c1233a94a61741e7af7c] | committer: Vittorio Giovara imc: fix order of operations in coefficients read Reported-by: Ruoyu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=787a6156a2d887bb1d65c1233a94a61741e7af7c --- libavcodec/imc.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index c1fbd76..359a36b 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -873,14 +873,14 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch) flag = get_bits1(&q->gb); if (stream_format_code & 0x1) -imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf, - chctx->flcoeffs1, chctx->flcoeffs2); -else if (stream_format_code & 0x1) imc_read_level_coeffs_raw(q, stream_format_code, chctx->levlCoeffBuf); else imc_read_level_coeffs(q, stream_format_code, chctx->levlCoeffBuf); -if (stream_format_code & 0x4) +if (stream_format_code & 0x1) +imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf, + chctx->flcoeffs1, chctx->flcoeffs2); +else if (stream_format_code & 0x4) imc_decode_level_coefficients(q, chctx->levlCoeffBuf, chctx->flcoeffs1, chctx->flcoeffs2); else ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mpeg12: Always invoke the get_format() callback
ffmpeg | branch: release/2.2 | Rémi Denis-Courmont | Thu Sep 25 11:59:58 2014 +0300| [0989a120f1dec400c54fcb54670cb84bba36d99b] | committer: Luca Barbato mpeg12: Always invoke the get_format() callback Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0989a120f1dec400c54fcb54670cb84bba36d99b --- libavcodec/mpeg12dec.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index cb713fd..0a5654a 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1177,10 +1177,21 @@ static const enum AVPixelFormat mpeg12_hwaccel_pixfmt_list_420[] = { AV_PIX_FMT_NONE }; +static const enum AVPixelFormat mpeg12_pixfmt_list_422[] = { +AV_PIX_FMT_YUV422P, +AV_PIX_FMT_NONE +}; + +static const enum AVPixelFormat mpeg12_pixfmt_list_444[] = { +AV_PIX_FMT_YUV444P, +AV_PIX_FMT_NONE +}; + static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; +const enum AVPixelFormat *pix_fmts; #if FF_API_XVMC FF_DISABLE_DEPRECATION_WARNINGS @@ -1190,11 +1201,13 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif /* FF_API_XVMC */ if (s->chroma_format < 2) -return avctx->get_format(avctx, mpeg12_hwaccel_pixfmt_list_420); +pix_fmts = mpeg12_hwaccel_pixfmt_list_420; else if (s->chroma_format == 2) -return AV_PIX_FMT_YUV422P; +pix_fmts = mpeg12_pixfmt_list_422; else -return AV_PIX_FMT_YUV444P; +pix_fmts = mpeg12_pixfmt_list_444; + +return avctx->get_format(avctx, pix_fmts); } /* Call this function when we know all parameters. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '787a6156a2d887bb1d65c1233a94a61741e7af7c' into release/2.2
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sat Nov 1 15:26:20 2014 +0100| [7ac50d846c8f4db117baf277e91ccf0ffb0ce633] | committer: Michael Niedermayer Merge commit '787a6156a2d887bb1d65c1233a94a61741e7af7c' into release/2.2 * commit '787a6156a2d887bb1d65c1233a94a61741e7af7c': imc: fix order of operations in coefficients read Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ac50d846c8f4db117baf277e91ccf0ffb0ce633 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '72ed4166a64714952777fb028b546a52e5b4e2c2' into release/2.2
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sat Nov 1 15:26:51 2014 +0100| [3bb4c3e74dee88ceb4956f2a8da2574abf91a5b7] | committer: Michael Niedermayer Merge commit '72ed4166a64714952777fb028b546a52e5b4e2c2' into release/2.2 * commit '72ed4166a64714952777fb028b546a52e5b4e2c2': resample: Avoid off-by-1 errors in PTS calcs. Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3bb4c3e74dee88ceb4956f2a8da2574abf91a5b7 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '0989a120f1dec400c54fcb54670cb84bba36d99b' into release/2.2
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sat Nov 1 15:25:42 2014 +0100| [0f4c03cd634031181479ca94874e1b80b5638417] | committer: Michael Niedermayer Merge commit '0989a120f1dec400c54fcb54670cb84bba36d99b' into release/2.2 * commit '0989a120f1dec400c54fcb54670cb84bba36d99b': mpeg12: Always invoke the get_format() callback Conflicts: libavcodec/mpeg12dec.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f4c03cd634031181479ca94874e1b80b5638417 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] resample: Avoid off-by-1 errors in PTS calcs.
ffmpeg | branch: release/2.2 | Timothy B. Terriberry | Mon Oct 13 17:46:00 2014 -0700| [72ed4166a64714952777fb028b546a52e5b4e2c2] | committer: Anton Khirnov resample: Avoid off-by-1 errors in PTS calcs. The rounding used in the PTS calculations in filter_frame() does not actually match the number of samples output by the resampler. This leads to off-by-1 errors in the timestamps indicating gaps and underruns, even when the input timestamps are all contiguous. Bug-Id: 753 Signed-off-by: Anton Khirnov (cherry picked from commit 6cbbf0592f4f3940aac7f687850d1b726a2ea836) Signed-off-by: Anton Khirnov (cherry picked from commit ca8c62d187fdca13979379fb2ab172ed662aa2f8) Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=72ed4166a64714952777fb028b546a52e5b4e2c2 --- libavfilter/af_resample.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c index a89ab35..83c27b5 100644 --- a/libavfilter/af_resample.c +++ b/libavfilter/af_resample.c @@ -42,6 +42,7 @@ typedef struct ResampleContext { AVDictionary *options; int64_t next_pts; +int64_t next_in_pts; /* set by filter_frame() to signal an output frame to request_frame() */ int got_output; @@ -154,6 +155,7 @@ static int config_output(AVFilterLink *outlink) outlink->time_base = (AVRational){ 1, outlink->sample_rate }; s->next_pts= AV_NOPTS_VALUE; +s->next_in_pts = AV_NOPTS_VALUE; av_get_channel_layout_string(buf1, sizeof(buf1), -1, inlink ->channel_layout); @@ -260,7 +262,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } out->sample_rate = outlink->sample_rate; -if (in->pts != AV_NOPTS_VALUE) { +/* Only convert in->pts if there is a discontinuous jump. + This ensures that out->pts tracks the number of samples actually + output by the resampler in the absence of such a jump. + Otherwise, the rounding in av_rescale_q() and av_rescale() + causes off-by-1 errors. */ +if (in->pts != AV_NOPTS_VALUE && in->pts != s->next_in_pts) { out->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base) - av_rescale(delay, outlink->sample_rate, @@ -269,6 +276,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) out->pts = s->next_pts; s->next_pts = out->pts + out->nb_samples; +s->next_in_pts = in->pts + in->nb_samples; ret = ff_filter_frame(outlink, out); s->got_output = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Stop demuxing wtv on eof.
ffmpeg | branch: release/2.4 | Carl Eugen Hoyos | Thu Oct 2 09:41:57 2014 +0200| [857e391697287a97a810114fba0de52179e6c623] | committer: Carl Eugen Hoyos Stop demuxing wtv on eof. Fixes ticket #3991. Fixes ticket #3995. Fixes ticket #3997. Reviewed-by: Peter Ross Reviewed-by: Paul B Mahol (cherry picked from commit 6efe4137ce39fef35e3e7f274160958acdac7581) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=857e391697287a97a810114fba0de52179e6c623 --- libavformat/wtvdec.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 4cb3295..9cedae1 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -789,6 +789,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p len = avio_rl32(pb); if (len < 32) { int ret; +if (avio_feof(pb)) +return AVERROR_EOF; av_log(s, AV_LOG_WARNING, "encountered broken chunk\n"); if ((ret = recover(wtv, avio_tell(pb) - 20)) < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/options_table: add FF_COMPLIANCE_UNOFFICIAL
ffmpeg | branch: release/2.4 | Michael Niedermayer | Sun Oct 5 21:43:17 2014 +0200| [39518589e73ed08f6afad7dc0d7ced1bcfbdaf92] | committer: Carl Eugen Hoyos avformat/options_table: add FF_COMPLIANCE_UNOFFICIAL Fixes ticket 3959 Signed-off-by: Michael Niedermayer (cherry picked from commit c02ea58c5f0a77f20c8046041edb974bb4376f4c) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=39518589e73ed08f6afad7dc0d7ced1bcfbdaf92 --- libavformat/options_table.h |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/options_table.h b/libavformat/options_table.h index eb4115c..71024be 100644 --- a/libavformat/options_table.h +++ b/libavformat/options_table.h @@ -93,6 +93,7 @@ static const AVOption avformat_options[] = { {"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "strict"}, {"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, D|E, "strict"}, {"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"}, +{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, "strict"}, {"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"}, {"max_ts_probe", "maximum number of packets to read while waiting for the first timestamp", OFFSET(max_ts_probe), AV_OPT_TYPE_INT, { .i64 = 50 }, 0, INT_MAX, D }, {NULL}, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mpeg4vdpau: Fix priv data size.
ffmpeg | branch: master | Reimar Döffinger | Sat Nov 1 13:01:38 2014 +0100| [46353759cb3c90ad8eb4af6526c236513d477296] | committer: Reimar Döffinger mpeg4vdpau: Fix priv data size. Signed-off-by: Reimar Döffinger > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46353759cb3c90ad8eb4af6526c236513d477296 --- libavcodec/mpeg4videodec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 47ac523..846b691 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2795,7 +2795,7 @@ AVCodec ff_mpeg4_vdpau_decoder = { .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG4, -.priv_data_size = sizeof(MpegEncContext), +.priv_data_size = sizeof(Mpeg4DecContext), .init = decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/matroskadec: do not trust the default duration to be the real 1/ timebase if its less than 5fps
ffmpeg | branch: release/2.4 | Michael Niedermayer | Wed Oct 8 20:23:40 2014 +0200| [a8a6cdfcd7b64964513292da9317645a8a510191] | committer: Carl Eugen Hoyos avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps Fixes Ticket3980 Signed-off-by: Michael Niedermayer (cherry picked from commit be695ee389724d713e1b8a61ef899fe1795193ce) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8a6cdfcd7b64964513292da9317645a8a510191 --- libavformat/matroskadec.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index b8ddf67..e3cd1e4 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1920,7 +1920,8 @@ static int matroska_parse_tracks(AVFormatContext *s) av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, 10, track->default_duration, 3); #if FF_API_R_FRAME_RATE -if (st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L) +if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L +&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5L) st->r_frame_rate = st->avg_frame_rate; #endif } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpeg: increase score for short mpeg-ps by 1
ffmpeg | branch: release/2.3 | Michael Niedermayer | Sun Sep 7 19:18:21 2014 +0200| [4e2e997fafc68da52bf3ba112ae1828b774d0870] | committer: Carl Eugen Hoyos avformat/mpeg: increase score for short mpeg-ps by 1 Fixes Ticket 3855 Signed-off-by: Michael Niedermayer (cherry picked from commit 5109ce2017c15202275b33bce58ec9d88044eeb5) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e2e997fafc68da52bf3ba112ae1828b774d0870 --- libavformat/mpeg.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 7d0be5e..14a75c0 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -101,7 +101,7 @@ static int mpegps_probe(AVProbeData *p) if (sys > invalid && sys * 9 <= pspack * 10) return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2 - : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg + : AVPROBE_SCORE_EXTENSION / 2 + 1; // 1 more than .mpg if (pspack > invalid && (priv1 + vid + audio) * 10 >= pspack * 9) return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: Copy extradata if it has been initialized later from the encoder
ffmpeg | branch: release/2.3 | Michael Niedermayer | Sat Sep 6 04:42:48 2014 +0200| [48b586ca4e8c4b28a9de2396140fcacb2bfb9b1d] | committer: Carl Eugen Hoyos ffmpeg: Copy extradata if it has been initialized later from the encoder Fixes Ticket3909 Signed-off-by: Michael Niedermayer (cherry picked from commit ab84effdeda931a74d8503891488ed538619a5d3) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48b586ca4e8c4b28a9de2396140fcacb2bfb9b1d --- ffmpeg.c |8 1 file changed, 8 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index 3015ca8..af171d2 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -578,6 +578,14 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) AVCodecContext *avctx = ost->st->codec; int ret; +if (!ost->st->codec->extradata_size && ost->enc_ctx->extradata_size) { +ost->st->codec->extradata = av_mallocz(ost->enc_ctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); +if (ost->st->codec->extradata) { +memcpy(ost->st->codec->extradata, ost->enc_ctx->extradata, ost->enc_ctx->extradata_size); +ost->st->codec->extradata_size = ost->enc_ctx->extradata_size; +} +} + if ((avctx->codec_type == AVMEDIA_TYPE_VIDEO && video_sync_method == VSYNC_DROP) || (avctx->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0)) pkt->pts = pkt->dts = AV_NOPTS_VALUE; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpegts: Improve probe heuristic by considering the overall frequency of 0x47 headers
ffmpeg | branch: release/2.3 | Michael Niedermayer | Sat Sep 13 22:08:21 2014 +0200| [63ed7e09dd1e4b6a0721f3d5f74b4819d53e103c] | committer: Carl Eugen Hoyos avformat/mpegts: Improve probe heuristic by considering the overall frequency of 0x47 headers Fixes Ticket3939 Signed-off-by: Michael Niedermayer (cherry picked from commit 296cd9c432775bbf57867fd76e8d2f505a512569) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63ed7e09dd1e4b6a0721f3d5f74b4819d53e103c --- libavformat/mpegts.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index b1dd8c6..520644f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -504,9 +504,9 @@ static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter) static int analyze(const uint8_t *buf, int size, int packet_size, int *index) { int stat[TS_MAX_PACKET_SIZE]; +int stat_all = 0; int i; int best_score = 0; -int best_score2 = 0; memset(stat, 0, packet_size * sizeof(*stat)); @@ -514,17 +514,16 @@ static int analyze(const uint8_t *buf, int size, int packet_size, int *index) if (buf[i] == 0x47 && !(buf[i + 1] & 0x80) && buf[i + 3] != 0x47) { int x = i % packet_size; stat[x]++; +stat_all++; if (stat[x] > best_score) { best_score = stat[x]; if (index) *index = x; -} else if (stat[x] > best_score2) { -best_score2 = stat[x]; } } } -return best_score - best_score2; +return best_score - FFMAX(stat_all - 10*best_score, 0)/10; } /* autodetect fec presence. Must have at least 1024 bytes */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mp3dec: Improve seeking frame sync code
ffmpeg | branch: release/2.3 | Michael Niedermayer | Sun Sep 7 21:44:19 2014 +0200| [19ccc06d8b617ba48c3122decf59b9e3376b415b] | committer: Carl Eugen Hoyos avformat/mp3dec: Improve seeking frame sync code Fixes Ticket3884 Signed-off-by: Michael Niedermayer (cherry picked from commit 1b5ccae0f2045ac86bc9e1257cec1b3fba81315f) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19ccc06d8b617ba48c3122decf59b9e3376b415b --- libavformat/mp3dec.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 8335388..8936854 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -398,6 +398,8 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int64_t ret = av_index_search_timestamp(st, timestamp, flags); int i, j; int dir = (flags&AVSEEK_FLAG_BACKWARD) ? -1 : 1; +int64_t best_pos; +int best_score; if (mp3->is_cbr && st->duration > 0 && mp3->header_filesize > s->data_offset) { int64_t filesize = avio_size(s->pb); @@ -421,28 +423,37 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, return -1; } -if (dir < 0) -avio_seek(s->pb, FFMAX(ie->pos - 4096, 0), SEEK_SET); +avio_seek(s->pb, FFMAX(ie->pos - 4096, 0), SEEK_SET); ret = avio_seek(s->pb, ie->pos, SEEK_SET); if (ret < 0) return ret; #define MIN_VALID 3 +best_pos = ie->pos; +best_score = 999; for(i=0; i<4096; i++) { -int64_t pos = ie->pos + i*dir; +int64_t pos = ie->pos + (dir > 0 ? i - 1024 : -i); +int64_t candidate = -1; +int score = 999; for(j=0; jpos - pos)*dir <= 0 && abs(MIN_VALID/2-j) < score) { +candidate = pos; +score = abs(MIN_VALID/2-j); +} pos += ret; } -if(j==MIN_VALID) -break; +if (best_score > score && j == MIN_VALID) { +best_pos = candidate; +best_score = score; +if(score == 0) +break; +} } -if(j!=MIN_VALID) -i=0; -ret = avio_seek(s->pb, ie->pos + i*dir, SEEK_SET); +ret = avio_seek(s->pb, best_pos, SEEK_SET); if (ret < 0) return ret; ff_update_cur_dts(s, st, ie->timestamp); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/matroskadec: do not trust the default duration to be the real 1/ timebase if its less than 5fps
ffmpeg | branch: release/2.3 | Michael Niedermayer | Wed Oct 8 20:23:40 2014 +0200| [4f515913a205475433c622aca14612f4d4a3cda0] | committer: Carl Eugen Hoyos avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps Fixes Ticket3980 Signed-off-by: Michael Niedermayer (cherry picked from commit be695ee389724d713e1b8a61ef899fe1795193ce) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f515913a205475433c622aca14612f4d4a3cda0 --- libavformat/matroskadec.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index fdfba57..ea0b5ab 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1979,7 +1979,8 @@ static int matroska_parse_tracks(AVFormatContext *s) av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, 10, track->default_duration, 3); #if FF_API_R_FRAME_RATE -if (st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L) +if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L +&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5L) st->r_frame_rate = st->avg_frame_rate; #endif } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/options_table: add FF_COMPLIANCE_UNOFFICIAL
ffmpeg | branch: release/2.3 | Michael Niedermayer | Sun Oct 5 21:43:17 2014 +0200| [10464ca0eba33672eb305da7270c37052245c035] | committer: Carl Eugen Hoyos avformat/options_table: add FF_COMPLIANCE_UNOFFICIAL Fixes ticket 3959 Signed-off-by: Michael Niedermayer (cherry picked from commit c02ea58c5f0a77f20c8046041edb974bb4376f4c) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10464ca0eba33672eb305da7270c37052245c035 --- libavformat/options_table.h |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/options_table.h b/libavformat/options_table.h index e3943fd..c1a66a8 100644 --- a/libavformat/options_table.h +++ b/libavformat/options_table.h @@ -93,6 +93,7 @@ static const AVOption avformat_options[] = { {"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "strict"}, {"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, D|E, "strict"}, {"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"}, +{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, "strict"}, {"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"}, {NULL}, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mjpegdec: Fix chroma width rounding
ffmpeg | branch: release/2.3 | Clément Bœsch | Sat Sep 13 20:25:27 2014 +0200| [193b949f715edc81cedd0bf116b7060e20d6a112] | committer: Carl Eugen Hoyos avcodec/mjpegdec: Fix chroma width rounding Fixes vertical line at the right side Fixes Ticket 3929 Signed-off-by: Michael Niedermayer (cherry picked from commit b96d864fd685aa1f661a5f8666224129d68b8eaf) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=193b949f715edc81cedd0bf116b7060e20d6a112 --- libavcodec/mjpegdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 6a02527..b29b340 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2128,7 +2128,7 @@ the_end: if (!(s->upscale_v & (1<>= hshift; +w = FF_CEIL_RSHIFT(w, hshift); for (i = s->height - 1; i; i--) { uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i / 2 * s->linesize[p]]; uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) / 2 * s->linesize[p]]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] utvideoenc: properly set slice height/last line
ffmpeg | branch: release/2.2 | Christophe Gisquet | Thu Oct 9 23:27:38 2014 +0200| [aa40f11b815a9a26aaa46198342749866fa18b27] | committer: Michael Niedermayer utvideoenc: properly set slice height/last line Mimic decoder and obey sampling. Does not affect fate tests for utvideo. Fixes ticket #3949. Signed-off-by: Michael Niedermayer (cherry picked from commit cb530dda7d76790b08ee3b7f67e251f3ce48c359) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa40f11b815a9a26aaa46198342749866fa18b27 --- libavcodec/utvideoenc.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index 0db85a8..1163cad 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -387,7 +387,7 @@ static int write_huff_codes(uint8_t *src, uint8_t *dst, int dst_size, } static int encode_plane(AVCodecContext *avctx, uint8_t *src, -uint8_t *dst, int stride, +uint8_t *dst, int stride, int plane_no, int width, int height, PutByteContext *pb) { UtvideoContext *c= avctx->priv_data; @@ -397,6 +397,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, HuffEntry he[256]; uint32_t offset = 0, slice_len = 0; +const int cmask = ~(!plane_no && avctx->pix_fmt == AV_PIX_FMT_YUV420P); int i, sstart, send = 0; int symbol; int ret; @@ -406,7 +407,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, case PRED_NONE: for (i = 0; i < c->slices; i++) { sstart = send; -send = height * (i + 1) / c->slices; +send = height * (i + 1) / c->slices & cmask; av_image_copy_plane(dst + sstart * width, width, src + sstart * stride, stride, width, send - sstart); @@ -415,7 +416,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, case PRED_LEFT: for (i = 0; i < c->slices; i++) { sstart = send; -send = height * (i + 1) / c->slices; +send = height * (i + 1) / c->slices & cmask; left_predict(src + sstart * stride, dst + sstart * width, stride, width, send - sstart); } @@ -423,7 +424,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, case PRED_MEDIAN: for (i = 0; i < c->slices; i++) { sstart = send; -send = height * (i + 1) / c->slices; +send = height * (i + 1) / c->slices & cmask; median_predict(c, src + sstart * stride, dst + sstart * width, stride, width, send - sstart); } @@ -487,7 +488,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, send = 0; for (i = 0; i < c->slices; i++) { sstart = send; -send= height * (i + 1) / c->slices; +send= height * (i + 1) / c->slices & cmask; /* * Write the huffman codes to a buffer, @@ -569,7 +570,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_RGBA: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride, - c->slice_buffer[i], c->slice_stride, + c->slice_buffer[i], c->slice_stride, i, width, height, &pb); if (ret) { @@ -581,7 +582,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_YUV422P: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0], - pic->linesize[i], width >> !!i, height, &pb); + pic->linesize[i], i, width >> !!i, height, &pb); if (ret) { av_log(avctx, AV_LOG_ERROR, "Error encoding plane %d.\n", i); @@ -592,7 +593,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_YUV420P: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0], - pic->linesize[i], width >> !!i, height >> !!i, + pic->linesize[i], i, width >> !!i, height >> !!i, &pb); if (ret) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/svq3: Dont memcpy AVFrame
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sat Oct 4 00:13:26 2014 +0200| [e812a089f549797f60dcc0e3846089538d7e8cf7] | committer: Michael Niedermayer avcodec/svq3: Dont memcpy AVFrame This avoids out of array accesses Fixes: asan_heap-uaf_21f42e4_9_asan_heap-uaf_21f42e4_278_gl2.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 075a165d2715837d125a9cc714fb430ccf6c9d6b) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e812a089f549797f60dcc0e3846089538d7e8cf7 --- libavcodec/svq3.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index d3c5672..3fb5173 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1168,7 +1168,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, h->cur_pic_ptr = s->cur_pic; av_frame_unref(&h->cur_pic.f); -h->cur_pic = *s->cur_pic; +memcpy(&h->cur_pic.tf, &s->cur_pic->tf, sizeof(h->cur_pic) - offsetof(Picture, tf)); ret = av_frame_ref(&h->cur_pic.f, &s->cur_pic->f); if (ret < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
ffmpeg | branch: release/2.2 | Michael Niedermayer | Wed Oct 29 14:15:29 2014 +0100| [16a4aef34574549316ba1a96a26edd1c9a4fb1e3] | committer: Michael Niedermayer avcodec/utils: Align dimensions by at least their chroma sub-sampling factors. Fixes: out of array accesses Fixes: asan_heap-oob_112c6b3_13_012.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit df74811cd53e45fcbbd3b77a1c42416816687c5c) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=16a4aef34574549316ba1a96a26edd1c9a4fb1e3 --- libavcodec/utils.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 8b6f942..8d24f0b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -281,6 +281,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int i; int w_align = 1; int h_align = 1; +AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt); + +if (desc) { +w_align = 1 << desc->log2_chroma_w; +h_align = 1 << desc->log2_chroma_h; +} switch (s->pix_fmt) { case AV_PIX_FMT_YUV420P: @@ -407,8 +413,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, } break; default: -w_align = 1; -h_align = 1; break; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/cook: check that the subpacket sizes fit in block_align
ffmpeg | branch: release/2.2 | Michael Niedermayer | Thu Oct 30 16:53:09 2014 +0100| [f00ec3307b5f61a5efbfa2a1d71817bb53fa397e] | committer: Michael Niedermayer avcodec/cook: check that the subpacket sizes fit in block_align Fixes out of array read Fixes: asan_heap-oob_fb5c50_19_018.rmvb Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 10e32618acce9c3fc64c061eb7907e8a8d2749ae) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f00ec3307b5f61a5efbfa2a1d71817bb53fa397e --- libavcodec/cook.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 402093c..48b79df 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1214,8 +1214,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) q->num_subpackets++; s++; -if (s > MAX_SUBPACKETS) { -avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS); +if (s > FFMIN(MAX_SUBPACKETS, avctx->block_align)) { +avpriv_request_sample(avctx, "subpackets > %d", FFMIN(MAX_SUBPACKETS, avctx->block_align)); return AVERROR_PATCHWELCOME; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dirac_arith: fix integer overflow
ffmpeg | branch: release/2.2 | Michael Niedermayer | Tue Oct 28 02:14:41 2014 +0100| [45361d8aa30093ba37abfea061327747710f9c9d] | committer: Michael Niedermayer avcodec/dirac_arith: fix integer overflow Fixes: asan_heap-oob_1078676_9_008.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 39680caceebfc6abf09b17032048752c014e57a8) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=45361d8aa30093ba37abfea061327747710f9c9d --- libavcodec/dirac_arith.h |4 1 file changed, 4 insertions(+) diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h index 089c71a..a1fa96b 100644 --- a/libavcodec/dirac_arith.h +++ b/libavcodec/dirac_arith.h @@ -171,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c { int ret = 1; while (!dirac_get_arith_bit(c, follow_ctx)) { +if (ret >= 0x4000) { +av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n"); +return -1; +} ret <<= 1; ret += dirac_get_arith_bit(c, data_ctx); follow_ctx = ff_dirac_next_ctx[follow_ctx]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
ffmpeg | branch: release/2.2 | Michael Niedermayer | Tue Oct 28 01:23:40 2014 +0100| [6505eb45bcf450473e606d0d233d7480d5071da6] | committer: Michael Niedermayer avcodec/diracdec: Use 64bit in calculation of codeblock coordinates Fixes integer overflow Fixes out of array read Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6505eb45bcf450473e606d0d233d7480d5071da6 --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 06d8b79..c4e9751 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -610,10 +610,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b top = 0; for (cb_y = 0; cb_y < cb_height; cb_y++) { -bottom = (b->height * (cb_y+1)) / cb_height; +bottom = (b->height * (cb_y+1LL)) / cb_height; left = 0; for (cb_x = 0; cb_x < cb_width; cb_x++) { -right = (b->width * (cb_x+1)) / cb_width; +right = (b->width * (cb_x+1LL)) / cb_width; codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith); left = right; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/svq1dec: zero terminate embedded message before printing
ffmpeg | branch: release/2.2 | Michael Niedermayer | Thu Oct 30 18:16:25 2014 +0100| [9b8b35910ffb312c4a9efcead6314ab003bacd83] | committer: Michael Niedermayer avcodec/svq1dec: zero terminate embedded message before printing Fixes out of array access Fixes: asan_stack-oob_49b1e5_10_009.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e91ba2efa949470e9157b652535d207a101f91e0) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b8b35910ffb312c4a9efcead6314ab003bacd83 --- libavcodec/svq1dec.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index eb64344..8641774 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -499,7 +499,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp, return result; } -static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out) +static void svq1_parse_string(GetBitContext *bitbuf, uint8_t out[257]) { uint8_t seed; int i; @@ -511,6 +511,7 @@ static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out) out[i] = get_bits(bitbuf, 8) ^ seed; seed = string_table[out[i] ^ seed]; } +out[i] = 0; } static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) @@ -553,12 +554,12 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) } if ((s->frame_code ^ 0x10) >= 0x50) { -uint8_t msg[256]; +uint8_t msg[257]; svq1_parse_string(bitbuf, msg); av_log(avctx, AV_LOG_INFO, - "embedded message:\n%s\n", (char *)msg); + "embedded message:\n%s\n", ((char *)msg) + 1); } skip_bits(bitbuf, 2); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/g2meet: check tile dimensions to avoid integer overflow
ffmpeg | branch: release/2.2 | Michael Niedermayer | Thu Oct 30 01:19:17 2014 +0100| [f6499563c3069ba4665906ed19fe80454ed00e1c] | committer: Michael Niedermayer avcodec/g2meet: check tile dimensions to avoid integer overflow Fixes out of array access Fixes: asan_heap-oob_12a55d3_30_029.wmv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 32e666c354e4a3160d8cf1d303cb51990b095c87) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f6499563c3069ba4665906ed19fe80454ed00e1c --- libavcodec/g2meet.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index aaf1abb..70419d8 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -724,8 +724,10 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, } c->tile_width = bytestream2_get_be32(&bc); c->tile_height = bytestream2_get_be32(&bc); -if (!c->tile_width || !c->tile_height || -((c->tile_width | c->tile_height) & 0xF)) { +if (c->tile_width <= 0 || c->tile_height <= 0 || +((c->tile_width | c->tile_height) & 0xF) || +c->tile_width * 4LL * c->tile_height >= INT_MAX +) { av_log(avctx, AV_LOG_ERROR, "Invalid tile dimensions %dx%d\n", c->tile_width, c->tile_height); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dxa: check dimensions
ffmpeg | branch: release/2.2 | Michael Niedermayer | Tue Oct 28 15:26:42 2014 +0100| [557e8bd58968606a280c228e3d9b267fe1875e8c] | committer: Michael Niedermayer avcodec/dxa: check dimensions Fixes out of array access Fixes: asan_heap-oob_11222fb_21_020.dxa Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=557e8bd58968606a280c228e3d9b267fe1875e8c --- libavcodec/dxa.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 0f64b5e..c8e3f71 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx) { DxaDecContext * const c = avctx->priv_data; +if (avctx->width%4 || avctx->height%4) { +avpriv_request_sample(avctx, "dimensions are not a multiple of 4"); +return AVERROR_INVALIDDATA; +} + c->prev = av_frame_alloc(); if (!c->prev) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
ffmpeg | branch: release/2.2 | Michael Niedermayer | Tue Oct 28 01:23:40 2014 +0100| [81e1b5f5fe5b1200bd6baf4876f6631af590] | committer: Michael Niedermayer avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y Fixes very long but finite loop Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 5145d22b88b9835db81c4d286b931a78e08ab76a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81e1b5f5fe5b1200bd6baf4876f6631af590 --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index c4e9751..5579dfb 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1002,8 +1002,8 @@ static int dirac_unpack_idwt_params(DiracContext *s) /* Codeblock parameters (core syntax only) */ if (get_bits1(gb)) { for (i = 0; i <= s->wavelet_depth; i++) { -CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n") -CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n") +CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n") +CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n") } CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n") ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc: fix qp count
ffmpeg | branch: release/2.2 | Michael Niedermayer | Mon Oct 13 16:02:42 2014 +0200| [17f0581e0dd587c1f7709eb5a6d52311923ed9ca] | committer: Michael Niedermayer postproc: fix qp count Found-by: ubitux Signed-off-by: Michael Niedermayer (cherry picked from commit 0b7e5d0d75e7d8762dd04d35f8c0821736164372) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=17f0581e0dd587c1f7709eb5a6d52311923ed9ca --- libpostproc/postprocess.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 54163c8..37206c5 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -979,7 +979,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if(pict_type & PP_PICT_TYPE_QP2){ int i; -const int count= mbHeight * absQPStride; +const int count= FFMAX(mbHeight * absQPStride, mbWidth); for(i=0; i<(count>>2); i++){ ((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F; } @@ -1004,7 +1004,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if((pict_type&7)!=3){ if (QPStride >= 0){ int i; -const int count= mbHeight * FFMAX(QPStride, mbWidth); +const int count= FFMAX(mbHeight * QPStride, mbWidth); for(i=0; i<(count>>2); i++){ ((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dnxhddec: treat pix_fmt like width/height
ffmpeg | branch: release/2.2 | Michael Niedermayer | Wed Oct 29 00:57:07 2014 +0100| [6352153811161f859433299a811d34cdb51afbd7] | committer: Michael Niedermayer avcodec/dnxhddec: treat pix_fmt like width/height Fixes out of array accesses Fixes: asan_heap-oob_22c9a39_16_015.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit f3c0e0bf6f53df0977f3878d4f5cec99dff8de9e) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6352153811161f859433299a811d34cdb51afbd7 --- libavcodec/dnxhddec.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 0f9fd16..f00d866 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -36,6 +36,7 @@ typedef struct DNXHDContext { GetBitContext gb; int64_t cid;///< compression id unsigned int width, height; +enum AVPixelFormat pix_fmt; unsigned int mb_width, mb_height; uint32_t mb_scan_index[68]; /* max for 1080p */ int cur_field; ///< current interlaced field @@ -133,7 +134,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->is_444 = 0; if (buf[0x4] == 0x2) { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10; +ctx->pix_fmt = AV_PIX_FMT_YUV444P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { ff_dsputil_init(&ctx->dsp, ctx->avctx); @@ -142,7 +143,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, } ctx->is_444 = 1; } else if (buf[0x21] & 0x40) { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10; +ctx->pix_fmt = AV_PIX_FMT_YUV422P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { ff_dsputil_init(&ctx->dsp, ctx->avctx); @@ -150,7 +151,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->decode_dct_block = dnxhd_decode_dct_block_10; } } else { -ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P; +ctx->pix_fmt = AV_PIX_FMT_YUV422P; ctx->avctx->bits_per_raw_sample = 8; if (ctx->bit_depth != 8) { ff_dsputil_init(&ctx->dsp, ctx->avctx); @@ -432,7 +433,13 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, avctx->width, avctx->height, ctx->width, ctx->height); first_field = 1; } +if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) { +av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n", + av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt)); +first_field = 1; +} +avctx->pix_fmt = ctx->pix_fmt; ret = ff_set_dimensions(avctx, ctx->width, ctx->height); if (ret < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc/postprocess: fix quant store for fq mode
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sun Oct 12 20:26:27 2014 +0200| [13b7962aae30e7eb3b6bababab5cc40fe95a4ccc] | committer: Michael Niedermayer postproc/postprocess: fix quant store for fq mode Signed-off-by: Michael Niedermayer (cherry picked from commit 941aaa39e8cd78ba4d16dfcec767290aec9a0136) Conflicts: tests/ref/fate/filter-pp3 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13b7962aae30e7eb3b6bababab5cc40fe95a4ccc --- libpostproc/postprocess.c |2 +- tests/ref/fate/filter-pp3 |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index da586ff..54163c8 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -1004,7 +1004,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if((pict_type&7)!=3){ if (QPStride >= 0){ int i; -const int count= mbHeight * QPStride; +const int count= mbHeight * FFMAX(QPStride, mbWidth); for(i=0; i<(count>>2); i++){ ((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F; } diff --git a/tests/ref/fate/filter-pp3 b/tests/ref/fate/filter-pp3 index ccf2eeb..1af8761 100644 --- a/tests/ref/fate/filter-pp3 +++ b/tests/ref/fate/filter-pp3 @@ -1 +1 @@ -pp3 39af1a30d0ea0e906df264773adfcaa6 +pp3 c8277ef31ab01bad51356841c9634522 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] update for 2.2.10
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sat Nov 1 16:00:25 2014 +0100| [41ee9a44955b65c3cfd188ebabe757da74bf0fc3] | committer: Michael Niedermayer update for 2.2.10 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41ee9a44955b65c3cfd188ebabe757da74bf0fc3 --- RELEASE |2 +- doc/Doxyfile |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE b/RELEASE index a6333e4..0d3ad67 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -2.2.9 +2.2.10 diff --git a/doc/Doxyfile b/doc/Doxyfile index afafc8d..751aa59 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.2.9 +PROJECT_NUMBER = 2.2.10 # With the PROJECT_LOGO tag one can specify a logo or icon that is included # in the documentation. The maximum height of the logo should not exceed 55 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpeg: increase score for short mpeg-ps by 1
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sun Sep 7 19:18:21 2014 +0200| [c9659dfd294211e3b95d6a5115466fde4acdd51a] | committer: Carl Eugen Hoyos avformat/mpeg: increase score for short mpeg-ps by 1 Fixes Ticket 3855 Signed-off-by: Michael Niedermayer (cherry picked from commit 5109ce2017c15202275b33bce58ec9d88044eeb5) Conflicts: libavformat/mpeg.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9659dfd294211e3b95d6a5115466fde4acdd51a --- libavformat/mpeg.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 1777283..a9016b9 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -91,16 +91,20 @@ static int mpegps_probe(AVProbeData *p) if(vid+audio > invalid+1) /* invalid VDR files nd short PES streams */ score = AVPROBE_SCORE_EXTENSION / 2; -if(sys>invalid && sys*9 <= pspack*10) -return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg -if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9) -return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg -if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */ -return (audio > 12 || vid > 3 + 2*invalid) ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; - -//02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1 -//mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6 -//Have\ Yourself\ a\ Merry\ Little\ Christmas.mp3 0 0 0 5 0 1 len:21618 +if (sys > invalid && sys * 9 <= pspack * 10) +return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2 + : AVPROBE_SCORE_EXTENSION / 2 + 1; // 1 more than .mpg +if (pspack > invalid && (priv1 + vid + audio) * 10 >= pspack * 9) +return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 + : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg +if ((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && +!pspack && p->buf_size > 2048 && vid + audio > invalid) /* PES stream */ +return (audio > 12 || vid > 3 + 2 * invalid) ? AVPROBE_SCORE_EXTENSION + 2 + : AVPROBE_SCORE_EXTENSION / 2; + +// 02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1 +// mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6 +// Have\ Yourself\ a\ Merry\ Little\ Christmas.mp3 0 0 0 5 0 1 len:21618 return score; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mp3dec: Improve seeking frame sync code
ffmpeg | branch: release/2.2 | Michael Niedermayer | Sun Sep 7 21:44:19 2014 +0200| [114e4b970e0a0fa4a5ac4873e49eac227a4665ee] | committer: Carl Eugen Hoyos avformat/mp3dec: Improve seeking frame sync code Fixes Ticket3884 Signed-off-by: Michael Niedermayer (cherry picked from commit 1b5ccae0f2045ac86bc9e1257cec1b3fba81315f) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=114e4b970e0a0fa4a5ac4873e49eac227a4665ee --- libavformat/mp3dec.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index ba77bce..432d70e 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -295,6 +295,8 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int64_t ret = av_index_search_timestamp(st, timestamp, flags); int i, j; int dir = (flags&AVSEEK_FLAG_BACKWARD) ? -1 : 1; +int64_t best_pos; +int best_score; if (mp3->is_cbr && st->duration > 0 && mp3->header_filesize > s->data_offset) { int64_t filesize = avio_size(s->pb); @@ -318,28 +320,37 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, return -1; } -if (dir < 0) -avio_seek(s->pb, FFMAX(ie->pos - 4096, 0), SEEK_SET); +avio_seek(s->pb, FFMAX(ie->pos - 4096, 0), SEEK_SET); ret = avio_seek(s->pb, ie->pos, SEEK_SET); if (ret < 0) return ret; #define MIN_VALID 3 +best_pos = ie->pos; +best_score = 999; for(i=0; i<4096; i++) { -int64_t pos = ie->pos + i*dir; +int64_t pos = ie->pos + (dir > 0 ? i - 1024 : -i); +int64_t candidate = -1; +int score = 999; for(j=0; jpos - pos)*dir <= 0 && abs(MIN_VALID/2-j) < score) { +candidate = pos; +score = abs(MIN_VALID/2-j); +} pos += ret; } -if(j==MIN_VALID) -break; +if (best_score > score && j == MIN_VALID) { +best_pos = candidate; +best_score = score; +if(score == 0) +break; +} } -if(j!=MIN_VALID) -i=0; -ret = avio_seek(s->pb, ie->pos + i*dir, SEEK_SET); +ret = avio_seek(s->pb, best_pos, SEEK_SET); if (ret < 0) return ret; ff_update_cur_dts(s, st, ie->timestamp); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/matroskadec: do not trust the default duration to be the real 1/ timebase if its less than 5fps
ffmpeg | branch: release/2.2 | Michael Niedermayer | Wed Oct 8 20:23:40 2014 +0200| [64624c56784dbcec72d02c6e5c474d73cfa92a04] | committer: Carl Eugen Hoyos avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps Fixes Ticket3980 Signed-off-by: Michael Niedermayer (cherry picked from commit be695ee389724d713e1b8a61ef899fe1795193ce) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=64624c56784dbcec72d02c6e5c474d73cfa92a04 --- libavformat/matroskadec.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 4726e94..37e0d19 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1903,7 +1903,8 @@ static int matroska_read_header(AVFormatContext *s) av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, 10, track->default_duration, 3); #if FF_API_R_FRAME_RATE -if (st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L) +if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L +&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5L) st->r_frame_rate = st->avg_frame_rate; #endif } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mpeg4vdpau: Fix priv data size.
ffmpeg | branch: release/2.4 | Reimar Döffinger | Sat Nov 1 13:01:38 2014 +0100| [25fc3deed8001ecb60f6e0780d049adb01742e75] | committer: Carl Eugen Hoyos mpeg4vdpau: Fix priv data size. Signed-off-by: Reimar Döffinger (cherry picked from commit 46353759cb3c90ad8eb4af6526c236513d477296) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25fc3deed8001ecb60f6e0780d049adb01742e75 --- libavcodec/mpeg4videodec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 2281292..bc9264f 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2793,7 +2793,7 @@ AVCodec ff_mpeg4_vdpau_decoder = { .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG4, -.priv_data_size = sizeof(MpegEncContext), +.priv_data_size = sizeof(Mpeg4DecContext), .init = decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 27 04:30:11 2014 +0100| [9a641b909cb8132aeba0e112e5514b5e6f7b343d] | committer: Michael Niedermayer avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c Fixes Ticket4011 Signed-off-by: Michael Niedermayer (cherry picked from commit 69a9a90d2ef795162074be24e3ad2182a8676af2) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a641b909cb8132aeba0e112e5514b5e6f7b343d --- libavcodec/h264_parser.c | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 36cf980..14d709c 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -202,10 +202,10 @@ static int scan_mmco_reset(AVCodecParserContext *s) */ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, - const uint8_t *buf, int buf_size) + const uint8_t * const buf, int buf_size) { H264Context *h = s->priv_data; -const uint8_t *buf_end = buf + buf_size; +int buf_index, next_avc; unsigned int pps_id; unsigned int slice_type; int state = -1, got_reset = 0; @@ -225,26 +225,26 @@ static inline int parse_nal_units(AVCodecParserContext *s, if (!buf_size) return 0; +buf_index = 0; +next_avc = h->is_avc ? 0 : buf_size; for (;;) { int src_length, dst_length, consumed, nalsize = 0; -if (h->is_avc) { -int i; -if (h->nal_length_size >= buf_end - buf) break; -nalsize = 0; -for (i = 0; i < h->nal_length_size; i++) -nalsize = (nalsize << 8) | *buf++; -if (nalsize <= 0 || nalsize > buf_end - buf) { -av_log(h->avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize); + +if (buf_index >= next_avc) { +nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index); +if (nalsize < 0) break; -} -src_length = nalsize; +next_avc = buf_index + nalsize; } else { -buf = avpriv_find_start_code(buf, buf_end, &state); -if (buf >= buf_end) -break; ---buf; -src_length = buf_end - buf; +buf_index = find_start_code(buf, buf_size, buf_index, next_avc); +if (buf_index >= buf_size) +break; +if (buf_index >= next_avc) +continue; } +src_length = next_avc - buf_index; + +state = buf[buf_index]; switch (state & 0x1f) { case NAL_SLICE: case NAL_IDR_SLICE: @@ -261,10 +261,13 @@ static inline int parse_nal_units(AVCodecParserContext *s, } break; } -ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); +ptr = ff_h264_decode_nal(h, buf + buf_index, &dst_length, + &consumed, src_length); if (!ptr || dst_length < 0) break; +buf_index += consumed; + init_get_bits(&h->gb, ptr, 8 * dst_length); switch (h->nal_unit_type) { case NAL_SPS: @@ -439,7 +442,6 @@ static inline int parse_nal_units(AVCodecParserContext *s, return 0; /* no need to evaluate the rest */ } -buf += h->is_avc ? nalsize : consumed; } if (q264) return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Move get_avc_nalsize() and find_start_code() to h264.h
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 27 04:22:42 2014 +0100| [70f6d553d98e6f40f36ac1a85698e079629f7d0e] | committer: Michael Niedermayer Move get_avc_nalsize() and find_start_code() to h264.h This allows sharing them with the h264 parser Signed-off-by: Michael Niedermayer (cherry picked from commit 4898440f6bd19152373969159fff057b532c6374) Conflicts: libavcodec/h264.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70f6d553d98e6f40f36ac1a85698e079629f7d0e --- libavcodec/h264.c | 37 - libavcodec/h264.h | 37 + 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index c4f4b05..12713de 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1330,43 +1330,6 @@ int ff_set_ref_count(H264Context *h) static const uint8_t start_code[] = { 0x00, 0x00, 0x01 }; -static int find_start_code(const uint8_t *buf, int buf_size, - int buf_index, int next_avc) -{ -// start code prefix search -for (; buf_index + 3 < next_avc; buf_index++) -// This should always succeed in the first iteration. -if (buf[buf_index] == 0 && -buf[buf_index + 1] == 0 && -buf[buf_index + 2] == 1) -break; - -buf_index += 3; - -if (buf_index >= buf_size) -return buf_size; - -return buf_index; -} - -static int get_avc_nalsize(H264Context *h, const uint8_t *buf, - int buf_size, int *buf_index) -{ -int i, nalsize = 0; - -if (*buf_index >= buf_size - h->nal_length_size) -return -1; - -for (i = 0; i < h->nal_length_size; i++) -nalsize = (nalsize << 8) | buf[(*buf_index)++]; -if (nalsize <= 0 || nalsize > buf_size - *buf_index) { -av_log(h->avctx, AV_LOG_ERROR, - "AVC: nal size %d\n", nalsize); -return -1; -} -return nalsize; -} - static int get_bit_length(H264Context *h, const uint8_t *buf, const uint8_t *ptr, int dst_length, int i, int next_avc) diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 5ec4f0c..d0d818c 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1092,6 +1092,43 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h) 0x0001000100010001ULL)); } +static inline int find_start_code(const uint8_t *buf, int buf_size, + int buf_index, int next_avc) +{ +// start code prefix search +for (; buf_index + 3 < next_avc; buf_index++) +// This should always succeed in the first iteration. +if (buf[buf_index] == 0 && +buf[buf_index + 1] == 0 && +buf[buf_index + 2] == 1) +break; + +buf_index += 3; + +if (buf_index >= buf_size) +return buf_size; + +return buf_index; +} + +static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf, + int buf_size, int *buf_index) +{ +int i, nalsize = 0; + +if (*buf_index >= buf_size - h->nal_length_size) +return -1; + +for (i = 0; i < h->nal_length_size; i++) +nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++]; +if (nalsize <= 0 || nalsize > buf_size - *buf_index) { +av_log(h->avctx, AV_LOG_ERROR, + "AVC: nal size %d\n", nalsize); +return -1; +} +return nalsize; +} + int ff_h264_field_end(H264Context *h, int in_setup); int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264: simplify find_start_code()
ffmpeg | branch: release/2.4 | Michael Niedermayer | Mon Oct 27 04:24:20 2014 +0100| [5405ba7b635b23e565a308172771441ac76d1362] | committer: Michael Niedermayer avcodec/h264: simplify find_start_code() this also uses avpriv_find_start_code(), though no speed change is expected as the area searched is generally small Signed-off-by: Michael Niedermayer (cherry picked from commit 3b678da5e386c138316954e867d595f94051) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5405ba7b635b23e565a308172771441ac76d1362 --- libavcodec/h264.h | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libavcodec/h264.h b/libavcodec/h264.h index d0d818c..b94f06b 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -36,6 +36,7 @@ #include "h264dsp.h" #include "h264pred.h" #include "h264qpel.h" +#include "internal.h" // for avpriv_find_start_code() #include "me_cmp.h" #include "mpegutils.h" #include "parser.h" @@ -1095,20 +1096,11 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h) static inline int find_start_code(const uint8_t *buf, int buf_size, int buf_index, int next_avc) { -// start code prefix search -for (; buf_index + 3 < next_avc; buf_index++) -// This should always succeed in the first iteration. -if (buf[buf_index] == 0 && -buf[buf_index + 1] == 0 && -buf[buf_index + 2] == 1) -break; +uint32_t state = -1; -buf_index += 3; +buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1; -if (buf_index >= buf_size) -return buf_size; - -return buf_index; +return FFMIN(buf_index, buf_size); } static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/rtpdec_h261: code aligned to the HEVC code
ffmpeg | branch: master | Thomas Volkert | Sat Nov 1 13:01:53 2014 +0100| [8d9277c3c01c24616532f05a5a09c8bfc7387010] | committer: Michael Niedermayer avformat/rtpdec_h261: code aligned to the HEVC code Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d9277c3c01c24616532f05a5a09c8bfc7387010 --- libavformat/rtpdec_h261.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavformat/rtpdec_h261.c b/libavformat/rtpdec_h261.c index b902d2a..43244bb 100644 --- a/libavformat/rtpdec_h261.c +++ b/libavformat/rtpdec_h261.c @@ -32,7 +32,7 @@ struct PayloadContext { uint32_t timestamp; }; -static PayloadContext *h261_new_context(void) +static av_cold PayloadContext *h261_new_context(void) { return av_mallocz(sizeof(PayloadContext)); } @@ -45,7 +45,7 @@ static void h261_free_dyn_buffer(AVIOContext **dyn_buf) *dyn_buf = NULL; } -static void h261_free_context(PayloadContext *pl_ctx) +static av_cold void h261_free_context(PayloadContext *pl_ctx) { /* return if context is invalid */ if (!pl_ctx) @@ -80,16 +80,14 @@ int ff_h261_handle_packet(AVFormatContext *ctx, PayloadContext *data, int sbit, ebit, gobn, mbap, quant; int res; -//av_log(ctx, AV_LOG_DEBUG, "got h261 RTP packet with time: %u\n", timestamp); - /* drop data of previous packets in case of non-continuous (loss) packet stream */ if (data->buf && data->timestamp != *timestamp) { h261_free_dyn_buffer(&data->buf); } -/* sanity check for size of input packet */ -if (len < 5 /* 4 bytes header and 1 byte payload at least */) { -av_log(ctx, AV_LOG_ERROR, "Too short H.261 RTP packet\n"); +/* sanity check for size of input packet: 1 byte payload at least */ +if (len < RTP_H261_PAYLOAD_HEADER_SIZE + 1) { +av_log(ctx, AV_LOG_ERROR, "Too short RTP/H.261 packet, got %d bytes\n", len); return AVERROR_INVALIDDATA; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264: simplify find_start_code()
ffmpeg | branch: release/2.3 | Michael Niedermayer | Mon Oct 27 04:24:20 2014 +0100| [48bf926bad57b7b503742c63c46d355e52974059] | committer: Carl Eugen Hoyos avcodec/h264: simplify find_start_code() this also uses avpriv_find_start_code(), though no speed change is expected as the area searched is generally small Signed-off-by: Michael Niedermayer (cherry picked from commit 3b678da5e386c138316954e867d595f94051) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48bf926bad57b7b503742c63c46d355e52974059 --- libavcodec/h264.h | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 9083026..cf84e93 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -37,6 +37,7 @@ #include "h264dsp.h" #include "h264pred.h" #include "h264qpel.h" +#include "internal.h" // for avpriv_find_start_code() #include "mpegutils.h" #include "parser.h" #include "qpeldsp.h" @@ -1095,20 +1096,11 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h) static inline int find_start_code(const uint8_t *buf, int buf_size, int buf_index, int next_avc) { -// start code prefix search -for (; buf_index + 3 < next_avc; buf_index++) -// This should always succeed in the first iteration. -if (buf[buf_index] == 0 && -buf[buf_index + 1] == 0 && -buf[buf_index + 2] == 1) -break; +uint32_t state = -1; -buf_index += 3; +buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1; -if (buf_index >= buf_size) -return buf_size; - -return buf_index; +return FFMIN(buf_index, buf_size); } static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c
ffmpeg | branch: release/2.3 | Michael Niedermayer | Mon Oct 27 04:30:11 2014 +0100| [4b8cb3fe51eb7a654259dc39fadb4004786b3dc6] | committer: Carl Eugen Hoyos avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c Fixes Ticket4011 Signed-off-by: Michael Niedermayer (cherry picked from commit 69a9a90d2ef795162074be24e3ad2182a8676af2) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b8cb3fe51eb7a654259dc39fadb4004786b3dc6 --- libavcodec/h264_parser.c | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index a075bfa..1e1d758 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -203,10 +203,10 @@ static int scan_mmco_reset(AVCodecParserContext *s) */ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, - const uint8_t *buf, int buf_size) + const uint8_t * const buf, int buf_size) { H264Context *h = s->priv_data; -const uint8_t *buf_end = buf + buf_size; +int buf_index, next_avc; unsigned int pps_id; unsigned int slice_type; int state = -1, got_reset = 0; @@ -226,26 +226,26 @@ static inline int parse_nal_units(AVCodecParserContext *s, if (!buf_size) return 0; +buf_index = 0; +next_avc = h->is_avc ? 0 : buf_size; for (;;) { int src_length, dst_length, consumed, nalsize = 0; -if (h->is_avc) { -int i; -if (h->nal_length_size >= buf_end - buf) break; -nalsize = 0; -for (i = 0; i < h->nal_length_size; i++) -nalsize = (nalsize << 8) | *buf++; -if (nalsize <= 0 || nalsize > buf_end - buf) { -av_log(h->avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize); + +if (buf_index >= next_avc) { +nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index); +if (nalsize < 0) break; -} -src_length = nalsize; +next_avc = buf_index + nalsize; } else { -buf = avpriv_find_start_code(buf, buf_end, &state); -if (buf >= buf_end) -break; ---buf; -src_length = buf_end - buf; +buf_index = find_start_code(buf, buf_size, buf_index, next_avc); +if (buf_index >= buf_size) +break; +if (buf_index >= next_avc) +continue; } +src_length = next_avc - buf_index; + +state = buf[buf_index]; switch (state & 0x1f) { case NAL_SLICE: case NAL_IDR_SLICE: @@ -262,10 +262,13 @@ static inline int parse_nal_units(AVCodecParserContext *s, } break; } -ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); +ptr = ff_h264_decode_nal(h, buf + buf_index, &dst_length, + &consumed, src_length); if (ptr == NULL || dst_length < 0) break; +buf_index += consumed; + init_get_bits(&h->gb, ptr, 8 * dst_length); switch (h->nal_unit_type) { case NAL_SPS: @@ -440,7 +443,6 @@ static inline int parse_nal_units(AVCodecParserContext *s, return 0; /* no need to evaluate the rest */ } -buf += h->is_avc ? nalsize : consumed; } if (q264) return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Move get_avc_nalsize() and find_start_code() to h264.h
ffmpeg | branch: release/2.3 | Michael Niedermayer | Mon Oct 27 04:22:42 2014 +0100| [ab43652c67a47d3c26b7a19510fd910eb42fbe61] | committer: Carl Eugen Hoyos Move get_avc_nalsize() and find_start_code() to h264.h This allows sharing them with the h264 parser Signed-off-by: Michael Niedermayer (cherry picked from commit 4898440f6bd19152373969159fff057b532c6374) Conflicts: libavcodec/h264.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab43652c67a47d3c26b7a19510fd910eb42fbe61 --- libavcodec/h264.c | 37 - libavcodec/h264.h | 37 + 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 99a5577..297d498 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1330,43 +1330,6 @@ int ff_set_ref_count(H264Context *h) static const uint8_t start_code[] = { 0x00, 0x00, 0x01 }; -static int find_start_code(const uint8_t *buf, int buf_size, - int buf_index, int next_avc) -{ -// start code prefix search -for (; buf_index + 3 < next_avc; buf_index++) -// This should always succeed in the first iteration. -if (buf[buf_index] == 0 && -buf[buf_index + 1] == 0 && -buf[buf_index + 2] == 1) -break; - -buf_index += 3; - -if (buf_index >= buf_size) -return buf_size; - -return buf_index; -} - -static int get_avc_nalsize(H264Context *h, const uint8_t *buf, - int buf_size, int *buf_index) -{ -int i, nalsize = 0; - -if (*buf_index >= buf_size - h->nal_length_size) -return -1; - -for (i = 0; i < h->nal_length_size; i++) -nalsize = (nalsize << 8) | buf[(*buf_index)++]; -if (nalsize <= 0 || nalsize > buf_size - *buf_index) { -av_log(h->avctx, AV_LOG_ERROR, - "AVC: nal size %d\n", nalsize); -return -1; -} -return nalsize; -} - static int get_bit_length(H264Context *h, const uint8_t *buf, const uint8_t *ptr, int dst_length, int i, int next_avc) diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 7a6a652..9083026 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1092,6 +1092,43 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h) 0x0001000100010001ULL)); } +static inline int find_start_code(const uint8_t *buf, int buf_size, + int buf_index, int next_avc) +{ +// start code prefix search +for (; buf_index + 3 < next_avc; buf_index++) +// This should always succeed in the first iteration. +if (buf[buf_index] == 0 && +buf[buf_index + 1] == 0 && +buf[buf_index + 2] == 1) +break; + +buf_index += 3; + +if (buf_index >= buf_size) +return buf_size; + +return buf_index; +} + +static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf, + int buf_size, int *buf_index) +{ +int i, nalsize = 0; + +if (*buf_index >= buf_size - h->nal_length_size) +return -1; + +for (i = 0; i < h->nal_length_size; i++) +nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++]; +if (nalsize <= 0 || nalsize > buf_size - *buf_index) { +av_log(h->avctx, AV_LOG_ERROR, + "AVC: nal size %d\n", nalsize); +return -1; +} +return nalsize; +} + int ff_h264_field_end(H264Context *h, int in_setup); int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/matroskadec: do not trust the default duration to be the real 1/ timebase if its less than 5fps
ffmpeg | branch: release/1.2 | Michael Niedermayer | Wed Oct 8 20:23:40 2014 +0200| [1abb0e563918ffec4c76c12e23f1a0647062a0fe] | committer: Carl Eugen Hoyos avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps Fixes Ticket3980 Signed-off-by: Michael Niedermayer (cherry picked from commit be695ee389724d713e1b8a61ef899fe1795193ce) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1abb0e563918ffec4c76c12e23f1a0647062a0fe --- libavformat/matroskadec.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 1d0f1b2..767fa5e 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1785,7 +1785,8 @@ static int matroska_read_header(AVFormatContext *s) av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, 10, track->default_duration, 3); #if FF_API_R_FRAME_RATE -if (st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L) +if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L +&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5L) st->r_frame_rate = st->avg_frame_rate; #endif } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpeg: increase score for short mpeg-ps by 1
ffmpeg | branch: release/1.2 | Michael Niedermayer | Sun Sep 7 19:18:21 2014 +0200| [e5cf4d16c60e438ba027947645a1d0a732b49257] | committer: Carl Eugen Hoyos avformat/mpeg: increase score for short mpeg-ps by 1 Fixes Ticket 3855 Signed-off-by: Michael Niedermayer (cherry picked from commit 5109ce2017c15202275b33bce58ec9d88044eeb5) Conflicts: libavformat/mpeg.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5cf4d16c60e438ba027947645a1d0a732b49257 --- libavformat/mpeg.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 82957a1..a49fdbe 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -91,7 +91,7 @@ static int mpegps_probe(AVProbeData *p) score= AVPROBE_SCORE_MAX/4; if(sys>invalid && sys*9 <= pspack*10) -return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg +return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4+1; // +1 for .mpg if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9) return pspack > 2 ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/idet: add current frame classification to metadata
ffmpeg | branch: master | Kevin Mitchell | Sat Nov 1 04:10:15 2014 -0700| [ae6118de19a5fc02631842baf20675fa370f7a94] | committer: Michael Niedermayer avfilter/idet: add current frame classification to metadata Fixes ticket 3832 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae6118de19a5fc02631842baf20675fa370f7a94 --- doc/filters.texi | 13 + libavfilter/vf_idet.c | 12 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 7be29de..33f842b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -5577,9 +5577,17 @@ Detect video interlacing type. This filter tries to detect if the input is interlaced or progressive, top or bottom field first. +Single frame detection considers only immediately adjacent frames when classifying each frame. +Multiple frame detection incorporates the classification history of previous frames. + The filter will log these metadata values: @table @option +@item single.current_frame +Detected type of current frame using single-frame detection. One of: +``tff'' (top field first), ``bff'' (bottom field first), +``progressive'', or ``undetermined'' + @item single.tff Cumulative number of frames detected as top field first using single-frame detection. @@ -5589,6 +5597,11 @@ Cumulative number of frames detected as top field first using multiple-frame det @item single.bff Cumulative number of frames detected as bottom field first using single-frame detection. +@item multiple.current_frame +Detected type of current frame using multiple-frame detection. One of: +``tff'' (top field first), ``bff'' (bottom field first), +``progressive'', or ``undetermined'' + @item multiple.bff Cumulative number of frames detected as bottom field first using multiple-frame detection. diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index 56d4cfa..6f99f39 100644 --- a/libavfilter/vf_idet.c +++ b/libavfilter/vf_idet.c @@ -40,10 +40,10 @@ AVFILTER_DEFINE_CLASS(idet); static const char *type2str(Type type) { switch(type) { -case TFF : return "Top Field First "; -case BFF : return "Bottom Field First"; -case PROGRESSIVE : return "Progressive "; -case UNDETERMINED : return "Undetermined "; +case TFF : return "tff"; +case BFF : return "bff"; +case PROGRESSIVE : return "progressive"; +case UNDETERMINED : return "undetermined"; } return NULL; } @@ -149,13 +149,15 @@ static void filter(AVFilterContext *ctx) idet->prestat [ type] ++; idet->poststat[idet->last_type] ++; -av_log(ctx, AV_LOG_DEBUG, "Single frame:%s, Multi frame:%s\n", type2str(type), type2str(idet->last_type)); +av_log(ctx, AV_LOG_DEBUG, "Single frame:%12s, Multi frame:%12s\n", type2str(type), type2str(idet->last_type)); +av_dict_set(metadata, "lavfi.idet.single.current_frame", type2str(type), 0); av_dict_set_int(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 0); av_dict_set_int(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 0); av_dict_set_int(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 0); av_dict_set_int(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 0); +av_dict_set(metadata, "lavfi.idet.multiple.current_frame", type2str(idet->last_type), 0); av_dict_set_int(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 0); av_dict_set_int(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 0); av_dict_set_int(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 0); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/idet: add metadata to "current" frame instead of "next" frame
ffmpeg | branch: master | Kevin Mitchell | Sat Nov 1 04:10:15 2014 -0700| [2847843868c9d7d7e75e771fd79136a00840a8aa] | committer: Michael Niedermayer avfilter/idet: add metadata to "current" frame instead of "next" frame Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2847843868c9d7d7e75e771fd79136a00840a8aa --- libavfilter/version.h |2 +- libavfilter/vf_idet.c | 24 +--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libavfilter/version.h b/libavfilter/version.h index 2fa15eb..440c587 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -31,7 +31,7 @@ #define LIBAVFILTER_VERSION_MAJOR 5 #define LIBAVFILTER_VERSION_MINOR 2 -#define LIBAVFILTER_VERSION_MICRO 100 +#define LIBAVFILTER_VERSION_MICRO 101 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index b9c4070..56d4cfa 100644 --- a/libavfilter/vf_idet.c +++ b/libavfilter/vf_idet.c @@ -82,6 +82,7 @@ static void filter(AVFilterContext *ctx) int64_t delta=0; Type type, best_type; int match = 0; +AVDictionary **metadata = avpriv_frame_get_metadatap(idet->cur); for (i = 0; i < idet->csp->nb_components; i++) { int w = idet->cur->width; @@ -147,14 +148,25 @@ static void filter(AVFilterContext *ctx) idet->prestat [ type] ++; idet->poststat[idet->last_type] ++; + av_log(ctx, AV_LOG_DEBUG, "Single frame:%s, Multi frame:%s\n", type2str(type), type2str(idet->last_type)); + +av_dict_set_int(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 0); +av_dict_set_int(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 0); +av_dict_set_int(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 0); +av_dict_set_int(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 0); + +av_dict_set_int(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 0); +av_dict_set_int(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 0); +av_dict_set_int(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 0); +av_dict_set_int(metadata, "lavfi.idet.multiple.undetermined", idet->poststat[UNDETERMINED], 0); + } static int filter_frame(AVFilterLink *link, AVFrame *picref) { AVFilterContext *ctx = link->dst; IDETContext *idet = ctx->priv; -AVDictionary **metadata = avpriv_frame_get_metadatap(picref); if (idet->prev) av_frame_free(&idet->prev); @@ -178,16 +190,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) filter(ctx); -av_dict_set_int(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 0); -av_dict_set_int(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 0); -av_dict_set_int(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 0); -av_dict_set_int(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 0); - -av_dict_set_int(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 0); -av_dict_set_int(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 0); -av_dict_set_int(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 0); -av_dict_set_int(metadata, "lavfi.idet.multiple.undetermined", idet->poststat[UNDETERMINED], 0); - return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur)); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c
ffmpeg | branch: release/2.2 | Michael Niedermayer | Mon Oct 27 04:30:11 2014 +0100| [969aee07e68c5930782bc46f2ac2391db55b8d1b] | committer: Michael Niedermayer avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c Fixes Ticket4011 Signed-off-by: Michael Niedermayer (cherry picked from commit 69a9a90d2ef795162074be24e3ad2182a8676af2) Conflicts: libavcodec/h264_parser.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=969aee07e68c5930782bc46f2ac2391db55b8d1b --- libavcodec/h264_parser.c | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 416f464..4d21f3b 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -202,10 +202,10 @@ static int scan_mmco_reset(AVCodecParserContext *s) */ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, - const uint8_t *buf, int buf_size) + const uint8_t * const buf, int buf_size) { H264Context *h = s->priv_data; -const uint8_t *buf_end = buf + buf_size; +int buf_index, next_avc; unsigned int pps_id; unsigned int slice_type; int state = -1, got_reset = 0; @@ -225,26 +225,26 @@ static inline int parse_nal_units(AVCodecParserContext *s, if (!buf_size) return 0; +buf_index = 0; +next_avc = h->is_avc ? 0 : buf_size; for (;;) { int src_length, dst_length, consumed, nalsize = 0; -if (h->is_avc) { -int i; -if (h->nal_length_size >= buf_end - buf) break; -nalsize = 0; -for (i = 0; i < h->nal_length_size; i++) -nalsize = (nalsize << 8) | *buf++; -if (nalsize <= 0 || nalsize > buf_end - buf) { -av_log(h->avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize); + +if (buf_index >= next_avc) { +nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index); +if (nalsize < 0) break; -} -src_length = nalsize; +next_avc = buf_index + nalsize; } else { -buf = avpriv_find_start_code(buf, buf_end, &state); -if (buf >= buf_end) -break; ---buf; -src_length = buf_end - buf; +buf_index = find_start_code(buf, buf_size, buf_index, next_avc); +if (buf_index >= buf_size) +break; +if (buf_index >= next_avc) +continue; } +src_length = next_avc - buf_index; + +state = buf[buf_index]; switch (state & 0x1f) { case NAL_SLICE: case NAL_IDR_SLICE: @@ -261,10 +261,13 @@ static inline int parse_nal_units(AVCodecParserContext *s, } break; } -ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); +ptr = ff_h264_decode_nal(h, buf + buf_index, &dst_length, + &consumed, src_length); if (ptr == NULL || dst_length < 0) break; +buf_index += consumed; + init_get_bits(&h->gb, ptr, 8 * dst_length); switch (h->nal_unit_type) { case NAL_SPS: @@ -439,7 +442,6 @@ static inline int parse_nal_units(AVCodecParserContext *s, return 0; /* no need to evaluate the rest */ } -buf += h->is_avc ? nalsize : consumed; } if (q264) return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264: simplify find_start_code()
ffmpeg | branch: release/2.2 | Michael Niedermayer | Mon Oct 27 04:24:20 2014 +0100| [76587eea6486bd7aaa65bcf8d923c88df9650843] | committer: Michael Niedermayer avcodec/h264: simplify find_start_code() this also uses avpriv_find_start_code(), though no speed change is expected as the area searched is generally small Signed-off-by: Michael Niedermayer (cherry picked from commit 3b678da5e386c138316954e867d595f94051) Conflicts: libavcodec/h264.h > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76587eea6486bd7aaa65bcf8d923c88df9650843 --- libavcodec/h264.h | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libavcodec/h264.h b/libavcodec/h264.h index ed0050a..e30e228 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -37,6 +37,7 @@ #include "h264dsp.h" #include "h264pred.h" #include "h264qpel.h" +#include "internal.h" // for avpriv_find_start_code() #include "rectangle.h" #define MAX_SPS_COUNT 32 @@ -1031,20 +1032,11 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h) static inline int find_start_code(const uint8_t *buf, int buf_size, int buf_index, int next_avc) { -// start code prefix search -for (; buf_index + 3 < next_avc; buf_index++) -// This should always succeed in the first iteration. -if (buf[buf_index] == 0 && -buf[buf_index + 1] == 0 && -buf[buf_index + 2] == 1) -break; +uint32_t state = -1; -buf_index += 3; +buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1; -if (buf_index >= buf_size) -return buf_size; - -return buf_index; +return FFMIN(buf_index, buf_size); } static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Move get_avc_nalsize() and find_start_code() to h264.h
ffmpeg | branch: release/2.2 | Michael Niedermayer | Mon Oct 27 04:22:42 2014 +0100| [667fe8c75b0b1f666f3215c797e00acb1024b3e5] | committer: Michael Niedermayer Move get_avc_nalsize() and find_start_code() to h264.h This allows sharing them with the h264 parser Signed-off-by: Michael Niedermayer (cherry picked from commit 4898440f6bd19152373969159fff057b532c6374) Conflicts: libavcodec/h264.c libavcodec/h264.h > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=667fe8c75b0b1f666f3215c797e00acb1024b3e5 --- libavcodec/h264.h | 36 1 file changed, 36 insertions(+) diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 188e749..ed0050a 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1028,6 +1028,42 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h) 0x0001000100010001ULL)); } +static inline int find_start_code(const uint8_t *buf, int buf_size, + int buf_index, int next_avc) +{ +// start code prefix search +for (; buf_index + 3 < next_avc; buf_index++) +// This should always succeed in the first iteration. +if (buf[buf_index] == 0 && +buf[buf_index + 1] == 0 && +buf[buf_index + 2] == 1) +break; + +buf_index += 3; + +if (buf_index >= buf_size) +return buf_size; + +return buf_index; +} + +static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf, + int buf_size, int *buf_index) +{ +int i, nalsize = 0; + +if (*buf_index >= buf_size - h->nal_length_size) +return -1; + +for (i = 0; i < h->nal_length_size; i++) +nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++]; +if (nalsize <= 0 || nalsize > buf_size - *buf_index) { +av_log(h->avctx, AV_LOG_ERROR, + "AVC: nal size %d\n", nalsize); +return -1; +} +return nalsize; +} void ff_h264_draw_horiz_band(H264Context *h, int y, int height); int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc); int ff_pred_weight_table(H264Context *h); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog