[FFmpeg-cvslog] lavd/xcbgrab: fix comparison with screen size.
ffmpeg | branch: release/2.6 | Nicolas George geo...@nsup.org | Wed May 6 11:53:19 2015 +0200| [1f7343c8145f76a482d5009e9b0739b4fcd1b891] | committer: Carl Eugen Hoyos lavd/xcbgrab: fix comparison with screen size. Signed-off-by: Nicolas George geo...@nsup.org Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 7971fa9ce0ead8d2e8a79dbe422e91dcef8222ba) http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f7343c8145f76a482d5009e9b0739b4fcd1b891 --- libavdevice/xcbgrab.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c index ab3a11e..fc20ca6 100644 --- a/libavdevice/xcbgrab.c +++ b/libavdevice/xcbgrab.c @@ -532,8 +532,8 @@ static int create_stream(AVFormatContext *s) gc = xcb_get_geometry(c-conn, c-screen-root); geo = xcb_get_geometry_reply(c-conn, gc, NULL); -if (c-x + c-width = geo-width || -c-y + c-height = geo-height) { +if (c-x + c-width geo-width || +c-y + c-height geo-height) { av_log(s, AV_LOG_ERROR, Capture area %dx%d at position %d.%d outside the screen size %dx%d\n, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/flacenc: Do not copy unused udata array - 5x faster calc_rice_params()
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Tue May 19 12:11:27 2015 +0200| [d3dcd2881247a5249d555f25f3f163a441c46237] | committer: Michael Niedermayer avcodec/flacenc: Do not copy unused udata array - 5x faster calc_rice_params() Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3dcd2881247a5249d555f25f3f163a441c46237 --- libavcodec/flacenc.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index b6dc4d5..e7f074b 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -667,7 +667,9 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax, bits[i] = calc_optimal_rice_params(tmp_rc, i, sums, n, pred_order); if (bits[i] bits[opt_porder]) { opt_porder = i; -*rc = tmp_rc; +rc-coding_mode = tmp_rc.coding_mode; +rc-porder = tmp_rc.porder; +memcpy(rc-params, tmp_rc.params, sizeof(rc-params)); } if (i == pmin) break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: Add test for -exact_rice_parameters 1
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Tue May 19 13:43:18 2015 +0200| [df5e408d32a096cb91f362a43e6018223bc5a911] | committer: Michael Niedermayer fate: Add test for -exact_rice_parameters 1 http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df5e408d32a096cb91f362a43e6018223bc5a911 --- tests/fate/acodec.mak|5 - tests/ref/acodec/flac-exact-rice |4 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak index 56301d3..d693e9e 100644 --- a/tests/fate/acodec.mak +++ b/tests/fate/acodec.mak @@ -113,10 +113,13 @@ fate-acodec-dca2: CMP_SHIFT = -2048 fate-acodec-dca2: CMP_TARGET = 527 fate-acodec-dca2: SIZE_TOLERANCE = 1632 -FATE_ACODEC-$(call ENCDEC, FLAC, FLAC) += fate-acodec-flac +FATE_ACODEC-$(call ENCDEC, FLAC, FLAC) += fate-acodec-flac fate-acodec-flac-exact-rice fate-acodec-flac: FMT = flac fate-acodec-flac: CODEC = flac -compression_level 2 +fate-acodec-flac-exact-rice: FMT = flac +fate-acodec-flac-exact-rice: CODEC = flac -compression_level 2 -exact_rice_parameters 1 + FATE_ACODEC-$(call ENCDEC, G723_1, G723_1) += fate-acodec-g723_1 fate-acodec-g723_1: tests/data/asynth-8000-1.wav fate-acodec-g723_1: SRC = tests/data/asynth-8000-1.wav diff --git a/tests/ref/acodec/flac-exact-rice b/tests/ref/acodec/flac-exact-rice new file mode 100644 index 000..6f6d274 --- /dev/null +++ b/tests/ref/acodec/flac-exact-rice @@ -0,0 +1,4 @@ +aab144de213ae684ca008a3e0afe5e28 *tests/data/fate/acodec-flac-exact-rice.flac +360454 tests/data/fate/acodec-flac-exact-rice.flac +95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-flac-exact-rice.out.wav +stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes: 1058400/ 1058400 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/flacenc: Support calculating rice parameters exactly
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Tue May 19 13:26:55 2015 +0200| [80f9d6e0ab242d0549ee47ffbfe8e58bd78cad12] | committer: Michael Niedermayer avcodec/flacenc: Support calculating rice parameters exactly Some files benefit by about 0.3% from this, and speedwise its ok other files do not benefit and encode to the same size Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80f9d6e0ab242d0549ee47ffbfe8e58bd78cad12 --- libavcodec/flacenc.c | 89 +++--- 1 file changed, 62 insertions(+), 27 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index e7f074b..3512e06 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -62,6 +62,7 @@ typedef struct CompressionOptions { int min_partition_order; int max_partition_order; int ch_mode; +int exact_rice_parameters; } CompressionOptions; typedef struct RiceContext { @@ -586,24 +587,44 @@ static int find_optimal_param(uint64_t sum, int n, int max_param) return FFMIN(k, max_param); } +static int find_optimal_param_exact(uint64_t sums[32][MAX_PARTITIONS], int i, int max_param) +{ +int bestk = 0; +int64_t bestbits = INT64_MAX; +int k; + +for (k = 0; k = max_param; k++) { +int64_t bits = sums[k][i]; +if (bits bestbits) { +bestbits = bits; +bestk = k; +} +} + +return bestk; +} static uint64_t calc_optimal_rice_params(RiceContext *rc, int porder, - uint64_t *sums, int n, int pred_order) + uint64_t sums[32][MAX_PARTITIONS], + int n, int pred_order, int max_param, int exact) { int i; -int k, cnt, part, max_param; +int k, cnt, part; uint64_t all_bits; -max_param = (1 rc-coding_mode) - 2; - part = (1 porder); all_bits = 4 * part; cnt = (n porder) - pred_order; for (i = 0; i part; i++) { -k = find_optimal_param(sums[i], cnt, max_param); +if (exact) { +k = find_optimal_param_exact(sums, i, max_param); +all_bits += sums[k][i]; +} else { +k = find_optimal_param(sums[0][i], cnt, max_param); +all_bits += rice_encode_count(sums[0][i], cnt, k); +} rc-params[i] = k; -all_bits += rice_encode_count(sums[i], cnt, k); cnt = n porder; } @@ -613,42 +634,55 @@ static uint64_t calc_optimal_rice_params(RiceContext *rc, int porder, } -static void calc_sum_top(int pmax, uint32_t *data, int n, int pred_order, - uint64_t sums[MAX_PARTITIONS]) +static void calc_sum_top(int pmax, int kmax, uint32_t *data, int n, int pred_order, + uint64_t sums[32][MAX_PARTITIONS]) { -int i; +int i, k; int parts; uint32_t *res, *res_end; /* sums for highest level */ parts = (1 pmax); -res = data[pred_order]; -res_end = data[n pmax]; -for (i = 0; i parts; i++) { -uint64_t sum = 0; -while (res res_end) -sum += *(res++); -sums[i] = sum; -res_end += n pmax; + +for (k = 0; k = kmax; k++) { +res = data[pred_order]; +res_end = data[n pmax]; +for (i = 0; i parts; i++) { +if (kmax) { +uint64_t sum = (1LL + k) * (res_end - res); +while (res res_end) +sum += *(res++) k; +sums[k][i] = sum; +} else { +uint64_t sum = 0; +while (res res_end) +sum += *(res++); +sums[k][i] = sum; +} +res_end += n pmax; +} } } -static void calc_sum_next(int level, uint64_t sums[MAX_PARTITIONS]) +static void calc_sum_next(int level, uint64_t sums[32][MAX_PARTITIONS], int kmax) { -int i; +int i, k; int parts = (1 level); -for (i = 0; i parts; i++) -sums[i] = sums[2*i] + sums[2*i+1]; +for (i = 0; i parts; i++) { +for (k=0; k=kmax; k++) +sums[k][i] = sums[k][2*i] + sums[k][2*i+1]; +} } static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax, - int32_t *data, int n, int pred_order) + int32_t *data, int n, int pred_order, int exact) { int i; uint64_t bits[MAX_PARTITION_ORDER+1]; int opt_porder; RiceContext tmp_rc; -uint64_t sums[MAX_PARTITIONS]; +uint64_t sums[32][MAX_PARTITIONS]; +int kmax = (1 rc-coding_mode) - 2; av_assert1(pmin = 0 pmin = MAX_PARTITION_ORDER); av_assert1(pmax = 0 pmax = MAX_PARTITION_ORDER); @@ -659,12 +693,12 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax, for (i = 0; i n; i++)
[FFmpeg-cvslog] avcodec/flacenc: Move udata and sums to FlacSubframe
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Tue May 19 13:48:30 2015 +0200| [7786a91b47e7918ec26293127bdfc6dd87ca2630] | committer: Michael Niedermayer avcodec/flacenc: Move udata and sums to FlacSubframe This significantly reduces the amount of stack space needed and also permits to simply copy the rice context again without speed penalty Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7786a91b47e7918ec26293127bdfc6dd87ca2630 --- libavcodec/flacenc.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 3512e06..d3f93f9 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -69,7 +69,6 @@ typedef struct RiceContext { enum CodingMode coding_mode; int porder; int params[MAX_PARTITIONS]; -uint32_t udata[FLAC_MAX_BLOCKSIZE]; } RiceContext; typedef struct FlacSubframe { @@ -80,7 +79,11 @@ typedef struct FlacSubframe { int order; int32_t coefs[MAX_LPC_ORDER]; int shift; + RiceContext rc; +uint32_t rc_udata[FLAC_MAX_BLOCKSIZE]; +uint64_t rc_sums[32][MAX_PARTITIONS]; + int32_t samples[FLAC_MAX_BLOCKSIZE]; int32_t residual[FLAC_MAX_BLOCKSIZE+11]; } FlacSubframe; @@ -674,14 +677,16 @@ static void calc_sum_next(int level, uint64_t sums[32][MAX_PARTITIONS], int kmax } } -static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax, +static uint64_t calc_rice_params(RiceContext *rc, + uint32_t udata[FLAC_MAX_BLOCKSIZE], + uint64_t sums[32][MAX_PARTITIONS], + int pmin, int pmax, int32_t *data, int n, int pred_order, int exact) { int i; uint64_t bits[MAX_PARTITION_ORDER+1]; int opt_porder; RiceContext tmp_rc; -uint64_t sums[32][MAX_PARTITIONS]; int kmax = (1 rc-coding_mode) - 2; av_assert1(pmin = 0 pmin = MAX_PARTITION_ORDER); @@ -691,9 +696,9 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax, tmp_rc.coding_mode = rc-coding_mode; for (i = 0; i n; i++) -rc-udata[i] = (2 * data[i]) ^ (data[i] 31); +udata[i] = (2 * data[i]) ^ (data[i] 31); -calc_sum_top(pmax, exact ? kmax : 0, rc-udata, n, pred_order, sums); +calc_sum_top(pmax, exact ? kmax : 0, udata, n, pred_order, sums); opt_porder = pmin; bits[pmin] = UINT32_MAX; @@ -701,9 +706,7 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax, bits[i] = calc_optimal_rice_params(tmp_rc, i, sums, n, pred_order, kmax, exact); if (bits[i] bits[opt_porder]) { opt_porder = i; -rc-coding_mode = tmp_rc.coding_mode; -rc-porder = tmp_rc.porder; -memcpy(rc-params, tmp_rc.params, sizeof(rc-params)); +*rc = tmp_rc; } if (i == pmin) break; @@ -734,7 +737,7 @@ static uint64_t find_subframe_rice_params(FlacEncodeContext *s, uint64_t bits = 8 + pred_order * sub-obits + 2 + sub-rc.coding_mode; if (sub-type == FLAC_SUBFRAME_LPC) bits += 4 + 5 + pred_order * s-options.lpc_coeff_precision; -bits += calc_rice_params(sub-rc, pmin, pmax, sub-residual, +bits += calc_rice_params(sub-rc, sub-rc_udata, sub-rc_sums, pmin, pmax, sub-residual, s-frame.blocksize, pred_order, s-options.exact_rice_parameters); return bits; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/flacenc: Support Multi dimensional quantization
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Wed May 20 01:23:39 2015 +0200| [b8e7f2b277b8c2ae2705ff10d6bafb696655e745] | committer: Michael Niedermayer avcodec/flacenc: Support Multi dimensional quantization Now with exact bit computations if exact_rice_parameters is enabled Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8e7f2b277b8c2ae2705ff10d6bafb696655e745 --- libavcodec/flacenc.c | 45 + 1 file changed, 45 insertions(+) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 79f821d..935d55f 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -63,6 +63,7 @@ typedef struct CompressionOptions { int max_partition_order; int ch_mode; int exact_rice_parameters; +int multi_dim_quant; } CompressionOptions; typedef struct RiceContext { @@ -932,6 +933,49 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch) opt_order++; } +if (s-options.multi_dim_quant) { +int allsteps = 1; +int i, step, improved; +int64_t best_score = INT64_MAX; +int32_t qmax; + +qmax = (1 (s-options.lpc_coeff_precision - 1)) - 1; + +for (i=0; iopt_order; i++) +allsteps *= 3; + +do { +improved = 0; +for (step = 0; step allsteps; step++) { +int tmp = step; +int32_t lpc_try[MAX_LPC_ORDER]; +int64_t score = 0; +int diffsum = 0; + +for (i=0; iopt_order; i++) { +int diff = ((tmp + 1) % 3) - 1; +lpc_try[i] = av_clip(coefs[opt_order - 1][i] + diff, -qmax, qmax); +tmp /= 3; +diffsum += !!diff; +} +if (diffsum 8) +continue; + +if (s-bps_code * 4 + s-options.lpc_coeff_precision + av_log2(opt_order - 1) = 32) { +s-flac_dsp.lpc16_encode(res, smp, n, opt_order, lpc_try, shift[opt_order-1]); +} else { +s-flac_dsp.lpc32_encode(res, smp, n, opt_order, lpc_try, shift[opt_order-1]); +} +score = find_subframe_rice_params(s, sub, opt_order); +if (score best_score) { +best_score = score; +memcpy(coefs[opt_order-1], lpc_try, sizeof(coefs[opt_order-1])); +improved=1; +} +} +} while(improved); +} + sub-order = opt_order; sub-type_code = sub-type | (sub-order-1); sub-shift = shift[sub-order-1]; @@ -1411,6 +1455,7 @@ static const AVOption options[] = { { right_side, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FLAC_CHMODE_RIGHT_SIDE }, INT_MIN, INT_MAX, FLAGS, ch_mode }, { mid_side, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FLAC_CHMODE_MID_SIDE }, INT_MIN, INT_MAX, FLAGS, ch_mode }, { exact_rice_parameters, Calculate rice parameters exactly, offsetof(FlacEncodeContext, options.exact_rice_parameters), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS }, +{ multi_dim_quant, Multi-dimensional quantization, offsetof(FlacEncodeContext, options.multi_dim_quant), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS }, { NULL }, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Fix movtext crashes caused due to lack of proper bounds checking
ffmpeg | branch: master | Niklesh niklesh.lalw...@iitb.ac.in | Tue May 19 18:40:55 2015 +0530| [b44a55ad2d182dc5dce09609badfb6dcb575e632] | committer: Philip Langdale Fix movtext crashes caused due to lack of proper bounds checking Signed-off-by: Niklesh niklesh.lalw...@iitb.ac.in http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b44a55ad2d182dc5dce09609badfb6dcb575e632 --- libavcodec/movtextdec.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index 3059599..53ffef0 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -96,7 +96,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx, char *ptr = avpkt-data; char *end; //char *ptr_temp; -int text_length, tsmb_type, style_entries, tsmb_size; +int text_length, tsmb_type, style_entries, tsmb_size, tracksize; int **style_start = {0,}; int **style_end = {0,}; int **style_flags = {0,}; @@ -135,20 +135,31 @@ static int mov_text_decode_frame(AVCodecContext *avctx, (AVRational){1,100}); tsmb_size = 0; +tracksize = 2 + text_length; // Note that the spec recommends lines be no longer than 2048 characters. av_bprint_init(buf, 0, AV_BPRINT_SIZE_UNLIMITED); if (text_length + 2 != avpkt-size) { -while (text_length + 2 + tsmb_size avpkt-size) { -tsmb = ptr + text_length + tsmb_size; +while (tracksize + 8 = avpkt-size) { +// A box is a minimum of 8 bytes. +tsmb = ptr + tracksize - 2; tsmb_size = AV_RB32(tsmb); tsmb += 4; tsmb_type = AV_RB32(tsmb); tsmb += 4; +if (tracksize + tsmb_size avpkt-size) +break; + if (tsmb_type == MKBETAG('s','t','y','l')) { +if (tracksize + 10 avpkt-size) +break; style_entries = AV_RB16(tsmb); tsmb += 2; +// A single style record is of length 12 bytes. +if (tracksize + 10 + style_entries * 12 avpkt-size) +break; + for(i = 0; i style_entries; i++) { style_pos = av_malloc(4); *style_pos = AV_RB16(tsmb); @@ -176,6 +187,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx, av_freep(style_end); av_freep(style_flags); } +tracksize = tracksize + tsmb_size; } } else text_to_ass(buf, ptr, end, NULL, NULL, 0, 0); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libvpx: Fix mixed use of av_malloc() and av_reallocp()
ffmpeg | branch: release/2.4 | Vittorio Giovara vittorio.giov...@gmail.com | Sun Mar 8 21:08:16 2015 +| [7244cefd6e6ba7258cb022dfd7a284099d88a3e8] | committer: Vittorio Giovara libvpx: Fix mixed use of av_malloc() and av_reallocp() This buffer is resized when vpx_codec_get_cx_data() returns a VPX_CODEC_STATS_PKT packet. CC: libav-sta...@libav.org Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7244cefd6e6ba7258cb022dfd7a284099d88a3e8 --- libavcodec/libvpxenc.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 2c43895..0323885 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -291,7 +291,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, if (enccfg.g_pass == VPX_RC_FIRST_PASS) enccfg.g_lag_in_frames = 0; else if (enccfg.g_pass == VPX_RC_LAST_PASS) { -int decode_size; +int decode_size, ret; if (!avctx-stats_in) { av_log(avctx, AV_LOG_ERROR, No stats file for second pass\n); @@ -299,12 +299,12 @@ static av_cold int vpx_init(AVCodecContext *avctx, } ctx-twopass_stats.sz = strlen(avctx-stats_in) * 3 / 4; -ctx-twopass_stats.buf = av_malloc(ctx-twopass_stats.sz); -if (!ctx-twopass_stats.buf) { +ret = av_reallocp(ctx-twopass_stats.buf, ctx-twopass_stats.sz); +if (ret 0) { av_log(avctx, AV_LOG_ERROR, Stat buffer alloc (%zu bytes) failed\n, ctx-twopass_stats.sz); -return AVERROR(ENOMEM); +return ret; } decode_size = av_base64_decode(ctx-twopass_stats.buf, avctx-stats_in, ctx-twopass_stats.sz); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mp3: Properly use AVCodecContext API
ffmpeg | branch: release/2.4 | Vittorio Giovara vittorio.giov...@gmail.com | Mon Mar 9 23:02:00 2015 +| [78a3a4580c5a547af4ae8682c662ea3a4699a599] | committer: Vittorio Giovara mp3: Properly use AVCodecContext API Rather than having an unitialized context on the stack, allocate it with defaults and free it when unneeded. CC: libav-sta...@libav.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=78a3a4580c5a547af4ae8682c662ea3a4699a599 --- libavformat/mp3dec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index bf12fdb..cba6778 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -31,6 +31,7 @@ #include id3v1.h #include replaygain.h +#include libavcodec/avcodec.h #include libavcodec/mpegaudiodecheader.h #define XING_FLAG_FRAMES 0x01 @@ -55,7 +56,10 @@ static int mp3_read_probe(AVProbeData *p) int fsize, frames, sample_rate; uint32_t header; uint8_t *buf, *buf0, *buf2, *end; -AVCodecContext avctx; +AVCodecContext *avctx = avcodec_alloc_context3(NULL); + +if (!avctx) +return AVERROR(ENOMEM); buf0 = p-buf; end = p-buf + p-buf_size - sizeof(uint32_t); @@ -70,7 +74,9 @@ static int mp3_read_probe(AVProbeData *p) for(frames = 0; buf2 end; frames++) { header = AV_RB32(buf2); -fsize = avpriv_mpa_decode_header(avctx, header, sample_rate, sample_rate, sample_rate, sample_rate); +fsize = avpriv_mpa_decode_header(avctx, header, sample_rate, + sample_rate, sample_rate, + sample_rate); if(fsize 0) break; buf2 += fsize; @@ -79,6 +85,7 @@ static int mp3_read_probe(AVProbeData *p) if(buf == buf0) first_frames= frames; } +avcodec_free_context(avctx); // keep this in sync with ac3 probe, both need to avoid // issues with MPEG-files! if (first_frames = 10) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '7244cefd6e6ba7258cb022dfd7a284099d88a3e8' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:14:16 2015 +0200| [d61022d55f1afe8ad05e883f43e186655e0769bb] | committer: Michael Niedermayer Merge commit '7244cefd6e6ba7258cb022dfd7a284099d88a3e8' into release/2.4 * commit '7244cefd6e6ba7258cb022dfd7a284099d88a3e8': libvpx: Fix mixed use of av_malloc() and av_reallocp() Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d61022d55f1afe8ad05e883f43e186655e0769bb --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mp3dec: properly allocate dummy AVCodecContext
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Thu Feb 26 19:59:44 2015 +0100| [a7dedd8ea53394cb7dc532aa8f2598c02327aa68] | committer: Michael Niedermayer avformat/mp3dec: properly allocate dummy AVCodecContext Fixes (harmless) use of uninitialized variable Found-by: jamrial Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 6ad42b3e15478284321dd285acaf189a16590854) Conflicts: libavformat/mp3dec.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7dedd8ea53394cb7dc532aa8f2598c02327aa68 --- libavformat/mp3dec.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index ea9f2c3..7ad6845 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -61,7 +61,7 @@ static int mp3_read_probe(AVProbeData *p) int fsize, frames, sample_rate; uint32_t header; const uint8_t *buf, *buf0, *buf2, *end; -AVCodecContext avctx; +AVCodecContext *avctx = avcodec_alloc_context3(NULL); buf0 = p-buf; end = p-buf + p-buf_size - sizeof(uint32_t); @@ -78,7 +78,7 @@ static int mp3_read_probe(AVProbeData *p) for(frames = 0; buf2 end; frames++) { header = AV_RB32(buf2); -fsize = avpriv_mpa_decode_header(avctx, header, sample_rate, sample_rate, sample_rate, sample_rate); +fsize = avpriv_mpa_decode_header(avctx, header, sample_rate, sample_rate, sample_rate, sample_rate); if(fsize 0) break; buf2 += fsize; @@ -87,6 +87,7 @@ static int mp3_read_probe(AVProbeData *p) if(buf == buf0) first_frames= frames; } +avcodec_free_context(avctx); // keep this in sync with ac3 probe, both need to avoid // issues with MPEG-files! if (first_frames=4) return AVPROBE_SCORE_EXTENSION + 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mp3dec: Check for avcodec_alloc_context3() failure
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Thu Feb 26 20:11:19 2015 +0100| [86be9cda97d2577165127c3b7075aa6a038995ab] | committer: Michael Niedermayer avformat/mp3dec: Check for avcodec_alloc_context3() failure Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit b851bc20c6931c084710e69f7eec30d8c1bdb68e) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=86be9cda97d2577165127c3b7075aa6a038995ab --- libavformat/mp3dec.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 7ad6845..b3a78d0 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -63,6 +63,9 @@ static int mp3_read_probe(AVProbeData *p) const uint8_t *buf, *buf0, *buf2, *end; AVCodecContext *avctx = avcodec_alloc_context3(NULL); +if (!avctx) +return 0; + buf0 = p-buf; end = p-buf + p-buf_size - sizeof(uint32_t); while(buf0 end !*buf0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '78a3a4580c5a547af4ae8682c662ea3a4699a599' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:25:47 2015 +0200| [d7888ff644f5965b7a54ecefea9af1469fd1d510] | committer: Michael Niedermayer Merge commit '78a3a4580c5a547af4ae8682c662ea3a4699a599' into release/2.4 * commit '78a3a4580c5a547af4ae8682c662ea3a4699a599': mp3: Properly use AVCodecContext API Conflicts: libavformat/mp3dec.c See: 6ad42b3e15478284321dd285acaf189a16590854 See: b851bc20c6931c084710e69f7eec30d8c1bdb68e Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7888ff644f5965b7a54ecefea9af1469fd1d510 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '2af720fe5f0418612a8fc26b0147a0e10414fcbe' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:39:42 2015 +0200| [b8d3c3ea86042300dab0b3b9ac31448f47f1c460] | committer: Michael Niedermayer Merge commit '2af720fe5f0418612a8fc26b0147a0e10414fcbe' into release/2.4 * commit '2af720fe5f0418612a8fc26b0147a0e10414fcbe': x86: Put COPY3_IF_LT under HAVE_6REGS Conflicts: libavcodec/x86/mathops.h See: b38910c9790253b362839042a17e13252c1d4b90 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8d3c3ea86042300dab0b3b9ac31448f47f1c460 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '8ae4d4e117626313e0b7df746e82de84d00d160a' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:40:33 2015 +0200| [60d0d68a8d6ac857e534df375c184a0ad232887a] | committer: Michael Niedermayer Merge commit '8ae4d4e117626313e0b7df746e82de84d00d160a' into release/2.4 * commit '8ae4d4e117626313e0b7df746e82de84d00d160a': mov: Fix little endian audio detection Conflicts: libavformat/mov.c See: d2549ba9df1a1aac8c0ae19bfca2c81e508ba02e Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=60d0d68a8d6ac857e534df375c184a0ad232887a --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '9f6c36d961d27283808310e3ca1d8390b55fce9b' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:37:23 2015 +0200| [e6f17337cf2081ccbf4635095ec3871805185867] | committer: Michael Niedermayer Merge commit '9f6c36d961d27283808310e3ca1d8390b55fce9b' into release/2.4 * commit '9f6c36d961d27283808310e3ca1d8390b55fce9b': roqvideoenc: set enc-avctx in roq_encode_init See: cf82c426fadf90105e1fb9d5ecd267cc3aa2b288 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6f17337cf2081ccbf4635095ec3871805185867 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] x86: Put COPY3_IF_LT under HAVE_6REGS
ffmpeg | branch: release/2.4 | Luca Barbato lu_z...@gentoo.org | Mon Mar 16 11:26:48 2015 +0100| [2af720fe5f0418612a8fc26b0147a0e10414fcbe] | committer: Vittorio Giovara x86: Put COPY3_IF_LT under HAVE_6REGS It uses 6 registers, unbreaks building on hardened x86 system. Bug-Id: gentoo/541930 CC: libav-sta...@libav.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2af720fe5f0418612a8fc26b0147a0e10414fcbe --- libavcodec/x86/mathops.h |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h index a62094e..2c04d9d 100644 --- a/libavcodec/x86/mathops.h +++ b/libavcodec/x86/mathops.h @@ -23,7 +23,9 @@ #define AVCODEC_X86_MATHOPS_H #include config.h + #include libavutil/common.h +#include libavutil/x86/asm.h #if HAVE_INLINE_ASM @@ -88,6 +90,7 @@ static inline av_const int mid_pred(int a, int b, int c) return i; } +#if HAVE_6REGS #define COPY3_IF_LT(x, y, a, b, c, d)\ __asm__ volatile(\ cmpl %0, %3 \n\t\ @@ -97,6 +100,8 @@ __asm__ volatile(\ : +r (x), +r (a), +r (c)\ : r (y), r (b), r (d)\ ); +#endif /* HAVE_6REGS */ + #endif /* HAVE_I686 */ #define MASK_ABS(mask, level) \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mov: Fix little endian audio detection
ffmpeg | branch: release/2.4 | Vittorio Giovara vittorio.giov...@gmail.com | Fri Mar 13 19:45:14 2015 +| [8ae4d4e117626313e0b7df746e82de84d00d160a] | committer: Vittorio Giovara mov: Fix little endian audio detection Set this field to TRUE if the audio component is to operate on little-endian data, and FALSE otherwise. However TRUE and FALSE are not defined. Since this flag is just a boolean, interpret all values except for 0 as little endian. Sample-Id: 64bit_FLOAT_Little_Endian.mov http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8ae4d4e117626313e0b7df746e82de84d00d160a --- libavformat/mov.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index d14dc7c..60d171d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -864,7 +864,7 @@ static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; st = c-fc-streams[c-fc-nb_streams-1]; -little_endian = avio_rb16(pb); +little_endian = !!avio_rb16(pb); av_dlog(c-fc, enda %d\n, little_endian); if (little_endian == 1) { switch (st-codec-codec_id) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] roqvideoenc: set enc-avctx in roq_encode_init
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Mon Mar 9 19:24:09 2015 +0100| [9f6c36d961d27283808310e3ca1d8390b55fce9b] | committer: Vittorio Giovara roqvideoenc: set enc-avctx in roq_encode_init So far it is only set in roq_encode_frame, but it is used in roq_encode_end to free the coded_frame. This currently segfaults if roq_encode_frame is not called between roq_encode_init and roq_encode_end. CC:libav-sta...@libav.org Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com Signed-off-by: Anton Khirnov an...@khirnov.net http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f6c36d961d27283808310e3ca1d8390b55fce9b --- libavcodec/roqvideoenc.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index af0089f..871371b 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -959,6 +959,8 @@ static av_cold int roq_encode_init(AVCodecContext *avctx) av_lfg_init(enc-randctx, 1); +enc-avctx = avctx; + enc-framesSinceKeyframe = 0; if ((avctx-width 0xf) || (avctx-height 0xf)) { av_log(avctx, AV_LOG_ERROR, Dimensions must be divisible by 16\n); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/pixfmt: Improve ascii art showing the meaning of the AVChromaLocation values
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Tue May 19 17:47:04 2015 +0200| [710abaf2c5d8132924f9a1b8486716cdc16d327f] | committer: Michael Niedermayer avutil/pixfmt: Improve ascii art showing the meaning of the AVChromaLocation values Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=710abaf2c5d8132924f9a1b8486716cdc16d327f --- libavutil/pixfmt.h | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index ba22eed..36b0f98 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -530,9 +530,13 @@ enum AVColorRange { /** * Location of chroma samples. * - * X X 3 4 X X are luma samples, - * 1 21-6 are possible chroma positions - * X X 5 6 X 0 is undefined/unknown position + * Illustration showing the location, the left shows only luma, the right + * shows the location of the chroma samples, the 2 could be imagined to overlay + * each other but are drawn seperately due to limitations of ASCII + * ____ + * |X X ...|3 4 X ... X are luma samples, + * | |1 2 1-6 are possible chroma positions + * |X X ...|5 6 X ... 0 is undefined/unknown position */ enum AVChromaLocation { AVCHROMA_LOC_UNSPECIFIED = 0, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mjpegenc: Fix JFIF header byte ordering
ffmpeg | branch: release/2.4 | Shiina Hideaki shi...@yndrd.com | Thu May 7 01:46:55 2015 +0100| [5549f693d2181b3211427f65e48eaa2f4fc5a402] | committer: Vittorio Giovara mjpegenc: Fix JFIF header byte ordering The header had a wrong version description. Bug-Id: 808 Signed-off-by: Shiina Hideaki shi...@yndrd.com Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5549f693d2181b3211427f65e48eaa2f4fc5a402 --- libavcodec/mjpegenc_common.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index adb335e..9373e4a 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_common.c @@ -96,7 +96,10 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p) put_marker(p, APP0); put_bits(p, 16, 16); avpriv_put_string(p, JFIF, 1); /* this puts the trailing zero-byte too */ -put_bits(p, 16, 0x0201); /* v 1.02 */ +/* The most significant byte is used for major revisions, the least + * significant byte for minor revisions. Version 1.02 is the current + * released revision. */ +put_bits(p, 16, 0x0102); put_bits(p, 8, 0); /* units type: 0 - aspect ratio */ put_bits(p, 16, avctx-sample_aspect_ratio.num); put_bits(p, 16, avctx-sample_aspect_ratio.den); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '5549f693d2181b3211427f65e48eaa2f4fc5a402' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 22:01:43 2015 +0200| [dcc800924925855df5dcb2cb8ee5263ded3fd84c] | committer: Michael Niedermayer Merge commit '5549f693d2181b3211427f65e48eaa2f4fc5a402' into release/2.4 * commit '5549f693d2181b3211427f65e48eaa2f4fc5a402': mjpegenc: Fix JFIF header byte ordering Conflicts: libavcodec/mjpegenc_common.c See: b19313218c32fa9446d474cbddb11c0776868cd3 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dcc800924925855df5dcb2cb8ee5263ded3fd84c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: Disable i686 for i586 and lower CPUs
ffmpeg | branch: release/2.4 | Mikulas Patocka miku...@artax.karlin.mff.cuni.cz | Mon Sep 15 05:11:21 2014 -0700| [b37bfbfbe53917820d1f97312fa0b2e8c7a15217] | committer: Vittorio Giovara configure: Disable i686 for i586 and lower CPUs http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b37bfbfbe53917820d1f97312fa0b2e8c7a15217 --- configure |1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 33a7a85..dd97ddf 100755 --- a/configure +++ b/configure @@ -3282,6 +3282,7 @@ elif enabled x86; then case $cpu in i[345]86|pentium) cpuflags=-march=$cpu +disable i686 disable mmx ;; # targets that do NOT support nopl and conditional mov (cmov) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b37bfbfbe53917820d1f97312fa0b2e8c7a15217' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 22:02:26 2015 +0200| [93ceae749b75d315a607db2cf1849762a27a4243] | committer: Michael Niedermayer Merge commit 'b37bfbfbe53917820d1f97312fa0b2e8c7a15217' into release/2.4 * commit 'b37bfbfbe53917820d1f97312fa0b2e8c7a15217': configure: Disable i686 for i586 and lower CPUs See: cdb3eee7c496f763d195de34be7f67783b98fb2c Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93ceae749b75d315a607db2cf1849762a27a4243 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] nut: Make sure to clean up on read_header failure
ffmpeg | branch: release/2.4 | Luca Barbato lu_z...@gentoo.org | Wed Apr 29 21:29:49 2015 +0200| [1f64b018cbec018fa66a4a20f79958d9707913de] | committer: Vittorio Giovara nut: Make sure to clean up on read_header failure Based on Andreas Cadhalpun andreas.cadhal...@googlemail.com work. CC: libav-sta...@libav.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f64b018cbec018fa66a4a20f79958d9707913de --- libavformat/nutdec.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 116c3d4..d669733 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -682,6 +682,20 @@ fail: return ret; } +static int nut_read_close(AVFormatContext *s) +{ +NUTContext *nut = s-priv_data; +int i; + +av_freep(nut-time_base); +av_freep(nut-stream); +ff_nut_free_sp(nut); +for (i = 1; i nut-header_count; i++) +av_freep(nut-header[i]); + +return 0; +} + static int nut_read_header(AVFormatContext *s) { NUTContext *nut = s-priv_data; @@ -697,7 +711,7 @@ static int nut_read_header(AVFormatContext *s) pos = find_startcode(bc, MAIN_STARTCODE, pos) + 1; if (pos 0 + 1) { av_log(s, AV_LOG_ERROR, No main startcode found.\n); -return AVERROR_INVALIDDATA; +goto fail; } } while (decode_main_header(nut) 0); @@ -707,7 +721,7 @@ static int nut_read_header(AVFormatContext *s) pos = find_startcode(bc, STREAM_STARTCODE, pos) + 1; if (pos 0 + 1) { av_log(s, AV_LOG_ERROR, Not all stream headers found.\n); -return AVERROR_INVALIDDATA; +goto fail; } if (decode_stream_header(nut) = 0) initialized_stream_count++; @@ -721,7 +735,7 @@ static int nut_read_header(AVFormatContext *s) if (startcode == 0) { av_log(s, AV_LOG_ERROR, EOF before video frames\n); -return AVERROR_INVALIDDATA; +goto fail; } else if (startcode == SYNCPOINT_STARTCODE) { nut-next_startcode = startcode; break; @@ -744,6 +758,11 @@ static int nut_read_header(AVFormatContext *s) ff_metadata_conv_ctx(s, NULL, ff_nut_metadata_conv); return 0; + +fail: +nut_read_close(s); + +return AVERROR_INVALIDDATA; } static int decode_frame_header(NUTContext *nut, int64_t *pts, int *stream_id, @@ -1018,20 +1037,6 @@ static int read_seek(AVFormatContext *s, int stream_index, return 0; } -static int nut_read_close(AVFormatContext *s) -{ -NUTContext *nut = s-priv_data; -int i; - -av_freep(nut-time_base); -av_freep(nut-stream); -ff_nut_free_sp(nut); -for (i = 1; i nut-header_count; i++) -av_freep(nut-header[i]); - -return 0; -} - AVInputFormat ff_nut_demuxer = { .name = nut, .long_name = NULL_IF_CONFIG_SMALL(NUT), ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '1f64b018cbec018fa66a4a20f79958d9707913de' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 22:01:11 2015 +0200| [fb2d1b1b136bf71915dcd86ad7da97cb7d8c8e1e] | committer: Michael Niedermayer Merge commit '1f64b018cbec018fa66a4a20f79958d9707913de' into release/2.4 * commit '1f64b018cbec018fa66a4a20f79958d9707913de': nut: Make sure to clean up on read_header failure Conflicts: libavformat/nutdec.c See: 361702660d2c37a63b7d6381d39e1e1de8405260 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb2d1b1b136bf71915dcd86ad7da97cb7d8c8e1e --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '0f50c53cfb959162f2bccc1a2c2e066d35723595' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 21:39:24 2015 +0200| [1ab5f63941fda78d4af256cc2529df9460b36c1a] | committer: Michael Niedermayer Merge commit '0f50c53cfb959162f2bccc1a2c2e066d35723595' into release/2.4 * commit '0f50c53cfb959162f2bccc1a2c2e066d35723595': png: Set the color range as full range Conflicts: libavcodec/pngdec.c Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ab5f63941fda78d4af256cc2529df9460b36c1a --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] nutdec: fix memleaks on error in nut_read_header
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Tue Apr 28 20:58:21 2015 +0200| [91aa6d8a8b9b18ca9bf5f83ccbc6abb302403a0b] | committer: Michael Niedermayer nutdec: fix memleaks on error in nut_read_header Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 361702660d2c37a63b7d6381d39e1e1de8405260) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91aa6d8a8b9b18ca9bf5f83ccbc6abb302403a0b --- libavformat/nutdec.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index f8c3fec..5c705ac 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -744,12 +744,14 @@ fail: return ret; } +static int nut_read_close(AVFormatContext *s); + static int nut_read_header(AVFormatContext *s) { NUTContext *nut = s-priv_data; AVIOContext *bc = s-pb; int64_t pos; -int initialized_stream_count; +int initialized_stream_count, ret = 0; nut-avf = s; @@ -759,7 +761,8 @@ static int nut_read_header(AVFormatContext *s) pos = find_startcode(bc, MAIN_STARTCODE, pos) + 1; if (pos 0 + 1) { av_log(s, AV_LOG_ERROR, No main startcode found.\n); -return AVERROR_INVALIDDATA; +ret = AVERROR_INVALIDDATA; +goto end; } } while (decode_main_header(nut) 0); @@ -769,7 +772,8 @@ static int nut_read_header(AVFormatContext *s) pos = find_startcode(bc, STREAM_STARTCODE, pos) + 1; if (pos 0 + 1) { av_log(s, AV_LOG_ERROR, Not all stream headers found.\n); -return AVERROR_INVALIDDATA; +ret = AVERROR_INVALIDDATA; +goto end; } if (decode_stream_header(nut) = 0) initialized_stream_count++; @@ -783,7 +787,8 @@ static int nut_read_header(AVFormatContext *s) if (startcode == 0) { av_log(s, AV_LOG_ERROR, EOF before video frames\n); -return AVERROR_INVALIDDATA; +ret = AVERROR_INVALIDDATA; +goto end; } else if (startcode == SYNCPOINT_STARTCODE) { nut-next_startcode = startcode; break; @@ -805,7 +810,10 @@ static int nut_read_header(AVFormatContext *s) ff_metadata_conv_ctx(s, NULL, ff_nut_metadata_conv); -return 0; +end: +if (ret 0) +nut_read_close(s); +return FFMIN(ret, 0); } static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int is_meta, int64_t maxpos) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] png: Set the color range as full range
ffmpeg | branch: release/2.4 | wm4 nfx...@googlemail.com | Fri May 8 17:01:50 2015 +0200| [0f50c53cfb959162f2bccc1a2c2e066d35723595] | committer: Vittorio Giovara png: Set the color range as full range The format uses full range for the gray formats. CC: libav-sta...@libav.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f50c53cfb959162f2bccc1a2c2e066d35723595 --- libavcodec/pngdec.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index fa7f7cc..2790bf4 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -645,6 +645,8 @@ static av_cold int png_dec_init(AVCodecContext *avctx) { PNGDecContext *s = avctx-priv_data; +avctx-color_range = AVCOL_RANGE_JPEG; + s-prev = av_frame_alloc(); if (!s-prev) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/flacenc: Mark pointers/array arguments const which are not changed
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Tue May 19 19:47:22 2015 +0200| [215410860f332d335fdf962762175a485777c1a7] | committer: Michael Niedermayer avcodec/flacenc: Mark pointers/array arguments const which are not changed Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=215410860f332d335fdf962762175a485777c1a7 --- libavcodec/flacenc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 16719a9..79f821d 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -509,7 +509,7 @@ static void copy_samples(FlacEncodeContext *s, const void *samples) } -static uint64_t rice_count_exact(int32_t *res, int n, int k) +static uint64_t rice_count_exact(const int32_t *res, int n, int k) { int i; uint64_t count = 0; @@ -637,12 +637,12 @@ static uint64_t calc_optimal_rice_params(RiceContext *rc, int porder, } -static void calc_sum_top(int pmax, int kmax, uint32_t *data, int n, int pred_order, +static void calc_sum_top(int pmax, int kmax, const uint32_t *data, int n, int pred_order, uint64_t sums[32][MAX_PARTITIONS]) { int i, k; int parts; -uint32_t *res, *res_end; +const uint32_t *res, *res_end; /* sums for highest level */ parts = (1 pmax); @@ -681,7 +681,7 @@ static uint64_t calc_rice_params(RiceContext *rc, uint32_t udata[FLAC_MAX_BLOCKSIZE], uint64_t sums[32][MAX_PARTITIONS], int pmin, int pmax, - int32_t *data, int n, int pred_order, int exact) + const int32_t *data, int n, int pred_order, int exact) { int i; uint64_t bits[MAX_PARTITION_ORDER+1]; @@ -1038,7 +1038,7 @@ static void remove_wasted_bits(FlacEncodeContext *s) } -static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n, +static int estimate_stereo_mode(const int32_t *left_ch, const int32_t *right_ch, int n, int max_rice_param) { int i, best; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/flacenc: Simplify md5 calculation code by using AV_WL24()
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Tue May 19 19:41:44 2015 +0200| [5dfcb4f74de56658b8c733ea27fae3abd07c4c2d] | committer: Michael Niedermayer avcodec/flacenc: Simplify md5 calculation code by using AV_WL24() Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5dfcb4f74de56658b8c733ea27fae3abd07c4c2d --- libavcodec/flacenc.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index d3f93f9..16719a9 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1278,9 +1278,7 @@ static int update_md5_sum(FlacEncodeContext *s, const void *samples) for (i = 0; i s-frame.blocksize * s-channels; i++) { int32_t v = samples0[i] 8; -*tmp++= (v ) 0xFF; -*tmp++= (v 8) 0xFF; -*tmp++= (v 16) 0xFF; +AV_WL24(tmp + 3*i, v); } buf = s-md5_buffer; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '844201e35fe575710be8218d45828df49b77f205' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:56:10 2015 +0200| [d45eef081469053c9487ef21254b03608f8f669d] | committer: Michael Niedermayer Merge commit '844201e35fe575710be8218d45828df49b77f205' into release/2.4 * commit '844201e35fe575710be8218d45828df49b77f205': mpegts: Update the PSI/SI table only if the version change Conflicts: libavformat/mpegts.c Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d45eef081469053c9487ef21254b03608f8f669d --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '4415d0f3bbaeb287327ef101ae98d727a69d9af1' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:48:19 2015 +0200| [d5f2302aca4bde75eee56a18121e0ad25a1de331] | committer: Michael Niedermayer Merge commit '4415d0f3bbaeb287327ef101ae98d727a69d9af1' into release/2.4 * commit '4415d0f3bbaeb287327ef101ae98d727a69d9af1': rtpenc_jpeg: Handle case of picture dimensions not dividing by 8 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d5f2302aca4bde75eee56a18121e0ad25a1de331 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] rtpenc_jpeg: Handle case of picture dimensions not dividing by 8
ffmpeg | branch: release/2.4 | Andrey Utkin andrey.krieger.ut...@gmail.com | Sat Apr 11 00:54:10 2015 +0300| [4415d0f3bbaeb287327ef101ae98d727a69d9af1] | committer: Vittorio Giovara rtpenc_jpeg: Handle case of picture dimensions not dividing by 8 This fixes the calculation of the number of needed blocks to make sure that ALL pixels are represented by the result. Signed-off-by: Martin Storsjö mar...@martin.st http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4415d0f3bbaeb287327ef101ae98d727a69d9af1 --- libavformat/rtpenc_jpeg.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtpenc_jpeg.c b/libavformat/rtpenc_jpeg.c index 9d0915b..b8c880a 100644 --- a/libavformat/rtpenc_jpeg.c +++ b/libavformat/rtpenc_jpeg.c @@ -40,8 +40,8 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) s-timestamp = s-cur_timestamp; /* convert video pixel dimensions from pixels to blocks */ -w = s1-streams[0]-codec-width 3; -h = s1-streams[0]-codec-height 3; +w = (s1-streams[0]-codec-width + 7) 3; +h = (s1-streams[0]-codec-height + 7) 3; /* get the pixel format type or fail */ if (s1-streams[0]-codec-pix_fmt == AV_PIX_FMT_YUVJ422P || ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mpegts: Update the PSI/SI table only if the version change
ffmpeg | branch: release/2.4 | John Högberg john.hogb...@ericsson.com | Tue Apr 28 10:20:33 2015 +0200| [844201e35fe575710be8218d45828df49b77f205] | committer: Vittorio Giovara mpegts: Update the PSI/SI table only if the version change If a PAT is finished while a PMT section filter is opened but not yet finished, the PMT section filter is closed and all the received data is discarded. This is usually not an issue but some multiplexers (With very quick PAT/PMT repetition settings) consistently emit a PMT section start, then a PAT, and then the rest of the PMT, causing the aforementioned behavior to result in no PMT being finished. In the most pathologic situation the stream information are lost and the probe fallback miscategorizes subtitles as mp3 audio. Avoid the issue through eliminating redundant PSI/SI table updates by checking their version field, which is required by the standard to be incremented on every change no matter how minor. CC: libav-sta...@libav.org Signed-off-by: Luca Barbato lu_z...@gentoo.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=844201e35fe575710be8218d45828df49b77f205 --- libavformat/mpegts.c | 20 1 file changed, 20 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index dced537..57efabd 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -73,6 +73,7 @@ typedef void SetServiceCallback (void *opaque, int ret); typedef struct MpegTSSectionFilter { int section_index; int section_h_size; +int last_ver; uint8_t *section_buf; unsigned int check_crc : 1; unsigned int end_of_section_reached : 1; @@ -354,6 +355,8 @@ static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, sec-opaque = opaque; sec-section_buf = av_malloc(MAX_SECTION_SIZE); sec-check_crc = check_crc; +sec-last_ver= -1; + if (!sec-section_buf) { av_free(filter); return NULL; @@ -1234,6 +1237,7 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) { MpegTSContext *ts = filter-u.section_filter.opaque; +MpegTSSectionFilter *tssf = filter-u.section_filter; SectionHeader h; const uint8_t *p, *p_end; AVIOContext pb; @@ -1248,6 +1252,9 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, return; if (h.tid != M4OD_TID) return; +if (h.version == tssf-last_ver) +return; +tssf-last_ver = h.version; mp4_read_od(s, p, (unsigned) (p_end - p), mp4_descr, mp4_descr_count, MAX_MP4_DESCR_COUNT); @@ -1433,6 +1440,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) { MpegTSContext *ts = filter-u.section_filter.opaque; +MpegTSSectionFilter *tssf = filter-u.section_filter; SectionHeader h1, *h = h1; PESContext *pes; AVStream *st; @@ -1452,6 +1460,9 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len p = section; if (parse_section_header(h, p, p_end) 0) return; +if (h-version == tssf-last_ver) +return; +tssf-last_ver = h-version; av_dlog(ts-stream, sid=0x%x sec_num=%d/%d\n, h-id, h-sec_num, h-last_sec_num); @@ -1583,6 +1594,7 @@ out: static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) { MpegTSContext *ts = filter-u.section_filter.opaque; +MpegTSSectionFilter *tssf = filter-u.section_filter; SectionHeader h1, *h = h1; const uint8_t *p, *p_end; int sid, pmt_pid; @@ -1596,6 +1608,9 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len return; if (h-tid != PAT_TID) return; +if (h-version == tssf-last_ver) +return; +tssf-last_ver = h-version; clear_programs(ts); for (;;) { @@ -1626,6 +1641,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) { MpegTSContext *ts = filter-u.section_filter.opaque; +MpegTSSectionFilter *tssf = filter-u.section_filter; SectionHeader h1, *h = h1; const uint8_t *p, *p_end, *desc_list_end, *desc_end; int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type; @@ -1640,6 +1656,10 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len return; if (h-tid != SDT_TID) return; +if (h-version == tssf-last_ver) +return; +tssf-last_ver = h-version; + onid = get16(p, p_end); if (onid 0) return; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpegts: Also parse the FMC descriptor if the codec has not been identified yet
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Wed Apr 29 06:26:18 2015 +0200| [52242a387b36fc05bf5fa65c4905927543b43ba7] | committer: Michael Niedermayer avformat/mpegts: Also parse the FMC descriptor if the codec has not been identified yet Fixes Detecting AAC with such descriptor if the parts needed for detection are later in the stream Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 14e9a20083c9c17c9431754bf13e458293c1ead4) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52242a387b36fc05bf5fa65c4905927543b43ba7 --- libavformat/mpegts.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 3aa616a..455615f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1555,7 +1555,9 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type case 0x1F: /* FMC descriptor */ get16(pp, desc_end); if (mp4_descr_count 0 -(st-codec-codec_id == AV_CODEC_ID_AAC_LATM || st-request_probe 0) +(st-codec-codec_id == AV_CODEC_ID_AAC_LATM || + (st-request_probe == 0 st-codec-codec_id == AV_CODEC_ID_NONE) || + st-request_probe 0) mp4_descr-dec_config_descr_len mp4_descr-es_id == pid) { AVIOContext pb; ffio_init_context(pb, mp4_descr-dec_config_descr, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpegts: Factorize version checking code out
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Wed Apr 29 22:24:09 2015 +0200| [3d296c0ec1d517260a658f02b5404def689918ab] | committer: Michael Niedermayer avformat/mpegts: Factorize version checking code out Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 4e8d01f20ce82b49f47c704a461c5d30866affaf) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d296c0ec1d517260a658f02b5404def689918ab --- libavformat/mpegts.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 455615f..62ecd64 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -568,6 +568,16 @@ typedef struct SectionHeader { uint8_t last_sec_num; } SectionHeader; +static int skip_identical(const SectionHeader *h, MpegTSSectionFilter *tssf) +{ +if (h-version == tssf-last_ver) +return 1; + +tssf-last_ver = h-version; + +return 0; +} + static inline int get8(const uint8_t **pp, const uint8_t *p_end) { const uint8_t *p; @@ -1455,9 +1465,8 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, return; if (h.tid != M4OD_TID) return; -if (h.version == tssf-last_ver) +if (skip_identical(h, tssf)) return; -tssf-last_ver = h.version; mp4_read_od(s, p, (unsigned) (p_end - p), mp4_descr, mp4_descr_count, MAX_MP4_DESCR_COUNT); @@ -1749,9 +1758,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len p = section; if (parse_section_header(h, p, p_end) 0) return; -if (h-version == tssf-last_ver) +if (skip_identical(h, tssf)) return; -tssf-last_ver = h-version; av_dlog(ts-stream, sid=0x%x sec_num=%d/%d\n, h-id, h-sec_num, h-last_sec_num); @@ -1917,9 +1925,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (ts-skip_changes) return; -if (h-version == tssf-last_ver) +if (skip_identical(h, tssf)) return; -tssf-last_ver = h-version; ts-stream-ts_id = h-id; clear_programs(ts); @@ -1990,9 +1997,8 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len return; if (ts-skip_changes) return; -if (h-version == tssf-last_ver) +if (skip_identical(h, tssf)) return; -tssf-last_ver = h-version; onid = get16(p, p_end); if (onid 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpegts: Detect changes in packet through CRC instead of just the 5bit version
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Fri May 1 02:14:14 2015 +0200| [8f3787d068c14ac2988a098de21118d122504498] | committer: Michael Niedermayer avformat/mpegts: Detect changes in packet through CRC instead of just the 5bit version Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit e0153145f6f8f3aa813652980862bafc8fd9b5c9) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8f3787d068c14ac2988a098de21118d122504498 --- libavformat/mpegts.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 8f03500..af5db08 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -76,6 +76,8 @@ typedef struct MpegTSSectionFilter { int section_index; int section_h_size; int last_ver; +unsigned crc; +unsigned last_crc; uint8_t *section_buf; unsigned int check_crc : 1; unsigned int end_of_section_reached : 1; @@ -409,6 +411,9 @@ static void write_section_data(MpegTSContext *ts, MpegTSFilter *tss1, if (tss-check_crc) { crc_valid = !av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, tss-section_buf, tss-section_h_size); +if (tss-section_h_size = 4) +tss-crc = AV_RB32(tss-section_buf + tss-section_h_size - 4); + if (crc_valid) { ts-crc_validity[ tss1-pid ] = 100; }else if (ts-crc_validity[ tss1-pid ] -10) { @@ -573,10 +578,11 @@ typedef struct SectionHeader { static int skip_identical(const SectionHeader *h, MpegTSSectionFilter *tssf) { -if (h-version == tssf-last_ver) +if (h-version == tssf-last_ver tssf-last_crc == tssf-crc) return 1; tssf-last_ver = h-version; +tssf-last_crc = tssf-crc; return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpegts: reset last_ver on corrupted packets
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Fri May 1 02:13:26 2015 +0200| [5b1befb074cfcb0590f0f4d1cc352630d0609336] | committer: Michael Niedermayer avformat/mpegts: reset last_ver on corrupted packets Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 4b6be54bed27eb7fc8f005505ff38e71b3c86cec) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b1befb074cfcb0590f0f4d1cc352630d0609336 --- libavformat/mpegts.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 62ecd64..8f03500 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -416,8 +416,11 @@ static void write_section_data(MpegTSContext *ts, MpegTSFilter *tss1, }else crc_valid = 2; } -if (crc_valid) +if (crc_valid) { tss-section_cb(tss1, tss-section_buf, tss-section_h_size); +if (crc_valid != 1) +tss-last_ver = -1; +} } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'f77c9d71615e17414aacbb1720693b800a5a32d3' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 20:50:46 2015 +0200| [efb28e3c510b7666107cd2aa25da61c9d33101b0] | committer: Michael Niedermayer Merge commit 'f77c9d71615e17414aacbb1720693b800a5a32d3' into release/2.4 * commit 'f77c9d71615e17414aacbb1720693b800a5a32d3': rtsp: Make sure we don't write too many transport entries into a fixed-size array Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=efb28e3c510b7666107cd2aa25da61c9d33101b0 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] rtsp: Make sure we don' t write too many transport entries into a fixed-size array
ffmpeg | branch: release/2.4 | Martin Storsjö mar...@martin.st | Fri Apr 24 12:38:09 2015 +0300| [f77c9d71615e17414aacbb1720693b800a5a32d3] | committer: Vittorio Giovara rtsp: Make sure we don't write too many transport entries into a fixed-size array CC: libav-sta...@libav.org Signed-off-by: Martin Storsjö mar...@martin.st http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f77c9d71615e17414aacbb1720693b800a5a32d3 --- libavformat/rtsp.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 4e79bc1..3d040d3 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -927,6 +927,8 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p) p++; reply-nb_transports++; +if (reply-nb_transports = RTSP_MAX_TRANSPORTS) +break; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpegts: reset last_version on seeking
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Wed Apr 29 05:00:51 2015 +0200| [74b856e58bd91a626f2212e323f7e9bb27846966] | committer: Michael Niedermayer avformat/mpegts: reset last_version on seeking Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 639781492684fcad05da52e7700bcbf6086599ea) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74b856e58bd91a626f2212e323f7e9bb27846966 --- libavformat/mpegts.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 3fe6aa4..3aa616a 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2293,6 +2293,8 @@ static int handle_packets(MpegTSContext *ts, int64_t nb_packets) av_buffer_unref(pes-buffer); pes-data_index = 0; pes-state = MPEGTS_SKIP; /* skip until pes header */ +} else if (ts-pids[i]-type == MPEGTS_SECTION) { +ts-pids[i]-u.section_filter.last_ver = -1; } ts-pids[i]-last_cc = -1; ts-pids[i]-last_pcr = -1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mux: Do not leave stale side data pointers in ff_interleave_add_packet()
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Fri May 1 23:55:42 2015 +0100| [386e80610de282c92ad5897683ccaf2675766ac5] | committer: Vittorio Giovara mux: Do not leave stale side data pointers in ff_interleave_add_packet() Signed-off-by: Michael Niedermayer michae...@gmx.at Signed-off-by: Vittorio Giovara vittorio.giov...@gmail.com http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=386e80610de282c92ad5897683ccaf2675766ac5 --- libavformat/mux.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mux.c b/libavformat/mux.c index df4f57a..d4492d1 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -400,6 +400,8 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS #endif pkt-buf = NULL; +pkt-side_data = NULL; +pkt-side_data_elems = 0; // Duplicate the packet if it uses non-allocated memory if ((ret = av_dup_packet(this_pktl-pkt)) 0) { av_free(this_pktl); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] apedec: prevent out of array writes in decode_array_0000
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Tue Apr 28 11:13:43 2015 +0200| [4e4708ad8093151b2b79276b7c2950a4462108b4] | committer: Michael Niedermayer apedec: prevent out of array writes in decode_array_ s-decoded_buffer is allocated with a min_size of: 2 * FFALIGN(blockstodecode, 8) * sizeof(*s-decoded_buffer) Then it is assigned to s-decoded[0] (and s-decoded_buffer + FFALIGN(blockstodecode, 8) to s-decoded[1]) and passed as out buffer to decode_array_. In this function 64 elements of the out buffer are written unconditionally and outside the array if blockstodecode is too small. This causes memory corruption, leading to segmentation faults or other crashes. Thus change decode_array_ to write at most blockstodecode elements of the out buffer. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 699341d647f7af785fb8ceed67604467b0b9ab12) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e4708ad8093151b2b79276b7c2950a4462108b4 --- libavcodec/apedec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 383b7fe..8607214 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -601,14 +601,14 @@ static void decode_array_(APEContext *ctx, GetBitContext *gb, int ksummax, ksummin; rice-ksum = 0; -for (i = 0; i 5; i++) { +for (i = 0; i FFMIN(blockstodecode, 5); i++) { out[i] = get_rice_ook(ctx-gb, 10); rice-ksum += out[i]; } rice-k = av_log2(rice-ksum / 10) + 1; if (rice-k = 24) return; -for (; i 64; i++) { +for (; i FFMIN(blockstodecode, 64); i++) { out[i] = get_rice_ook(ctx-gb, rice-k); rice-ksum += out[i]; rice-k = av_log2(rice-ksum / ((i + 1) * 2)) + 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avresample: Reallocate the internal buffer to the correct size
ffmpeg | branch: release/2.4 | Luca Barbato lu_z...@gentoo.org | Tue Apr 28 01:55:10 2015 +0200| [744d813bcf527481f2217428fa08bfee8642935b] | committer: Vittorio Giovara avresample: Reallocate the internal buffer to the correct size Fixes the corner case in which the internal buffer size is larger than input buffer provided and resizing it before moving the left over samples would make it write to now unallocated memory. Bug-Id: 825 CC: libav-sta...@libav.org Signed-off-by: Luca Barbato lu_z...@gentoo.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=744d813bcf527481f2217428fa08bfee8642935b --- libavresample/resample.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavresample/resample.c b/libavresample/resample.c index 4553b2c..679e9e9 100644 --- a/libavresample/resample.c +++ b/libavresample/resample.c @@ -432,7 +432,9 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src) int bps = av_get_bytes_per_sample(c-avr-internal_sample_fmt); int i; -ret = ff_audio_data_realloc(c-buffer, in_samples + c-padding_size); +ret = ff_audio_data_realloc(c-buffer, +FFMAX(in_samples, in_leftover) + +c-padding_size); if (ret 0) { av_log(c-avr, AV_LOG_ERROR, Error reallocating resampling buffer\n); return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'ac1660509ecfbeca7b63eb5ab8360011180e705b' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 21:08:45 2015 +0200| [3cc8285439ddb6d8b7eb108cdb7dc793a75e1dbd] | committer: Michael Niedermayer Merge commit 'ac1660509ecfbeca7b63eb5ab8360011180e705b' into release/2.4 * commit 'ac1660509ecfbeca7b63eb5ab8360011180e705b': ape: Support _ files with nblock smaller than 64 Conflicts: libavcodec/apedec.c See: 699341d647f7af785fb8ceed67604467b0b9ab12 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cc8285439ddb6d8b7eb108cdb7dc793a75e1dbd --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ape: Support _0000 files with nblock smaller than 64
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Wed Apr 29 20:39:22 2015 +0200| [ac1660509ecfbeca7b63eb5ab8360011180e705b] | committer: Vittorio Giovara ape: Support _ files with nblock smaller than 64 The decode_array_ assumed that 64 is the minimal block size while it is not. CC: libav-sta...@libav.org Signed-off-by: Luca Barbato lu_z...@gentoo.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac1660509ecfbeca7b63eb5ab8360011180e705b --- libavcodec/apedec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 344c85b..131c6f3 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -614,12 +614,12 @@ static void decode_array_(APEContext *ctx, GetBitContext *gb, int ksummax, ksummin; rice-ksum = 0; -for (i = 0; i 5; i++) { +for (i = 0; i FFMIN(blockstodecode, 5); i++) { out[i] = get_rice_ook(ctx-gb, 10); rice-ksum += out[i]; } rice-k = av_log2(rice-ksum / 10) + 1; -for (; i 64; i++) { +for (; i FFMIN(blockstodecode, 64); i++) { out[i] = get_rice_ook(ctx-gb, rice-k); rice-ksum += out[i]; rice-k = av_log2(rice-ksum / ((i + 1) * 2)) + 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '744d813bcf527481f2217428fa08bfee8642935b' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 21:07:02 2015 +0200| [39cb08cdc20af8662b0f3cac749c7f707ec7448f] | committer: Michael Niedermayer Merge commit '744d813bcf527481f2217428fa08bfee8642935b' into release/2.4 * commit '744d813bcf527481f2217428fa08bfee8642935b': avresample: Reallocate the internal buffer to the correct size Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=39cb08cdc20af8662b0f3cac749c7f707ec7448f --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '386e80610de282c92ad5897683ccaf2675766ac5' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 21:07:24 2015 +0200| [8624b49276558d451cf3c494d30975f31e926afb] | committer: Michael Niedermayer Merge commit '386e80610de282c92ad5897683ccaf2675766ac5' into release/2.4 * commit '386e80610de282c92ad5897683ccaf2675766ac5': mux: Do not leave stale side data pointers in ff_interleave_add_packet() Conflicts: libavformat/mux.c See: bfb3ed1a9d5dafdc185080fdd88d02ff7221d30a Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8624b49276558d451cf3c494d30975f31e926afb --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] nut: Check chapter creation in decode_info_header
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Tue Apr 28 20:57:59 2015 +0200| [21b21aed797b5e636adcf2df811f96a95f208930] | committer: Vittorio Giovara nut: Check chapter creation in decode_info_header This fixes a segmentation fault when accessing the metadata. Signed-off-by: Luca Barbato lu_z...@gentoo.org CC: libav-sta...@libav.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21b21aed797b5e636adcf2df811f96a95f208930 --- libavformat/nutdec.c |4 1 file changed, 4 insertions(+) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 36ca754..116c3d4 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -482,6 +482,10 @@ static int decode_info_header(NUTContext *nut) nut-time_base[chapter_start % nut-time_base_count], start, start + chapter_len, NULL); +if (!chapter) { +av_log(s, AV_LOG_ERROR, Could not create chapter.\n); +return AVERROR(ENOMEM); +} metadata = chapter-metadata; } else if (stream_id_plus1) { st = s-streams[stream_id_plus1 - 1]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '21b21aed797b5e636adcf2df811f96a95f208930' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 21:22:59 2015 +0200| [95b42188d6197c951738c491d3fddebf134d7755] | committer: Michael Niedermayer Merge commit '21b21aed797b5e636adcf2df811f96a95f208930' into release/2.4 * commit '21b21aed797b5e636adcf2df811f96a95f208930': nut: Check chapter creation in decode_info_header Conflicts: libavformat/nutdec.c See: 3ff1af2b0db7132d5717be6395227a94c8abab07 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95b42188d6197c951738c491d3fddebf134d7755 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] nutdec: check chapter creation in decode_info_header
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Tue Apr 28 20:57:59 2015 +0200| [63afe5b9140bacdf587cff0cd9427ab03fa76b72] | committer: Michael Niedermayer nutdec: check chapter creation in decode_info_header This fixes a segmentation fault when accessing the metadata. Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 3ff1af2b0db7132d5717be6395227a94c8abab07) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63afe5b9140bacdf587cff0cd9427ab03fa76b72 --- libavformat/nutdec.c |4 1 file changed, 4 insertions(+) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 11e7e43..7ae722b 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -505,6 +505,10 @@ static int decode_info_header(NUTContext *nut) nut-time_base[chapter_start % nut-time_base_count], start, start + chapter_len, NULL); +if (!chapter) { +av_log(s, AV_LOG_ERROR, could not create chapter\n); +return AVERROR(ENOMEM); +} metadata = chapter-metadata; } else if (stream_id_plus1) { st = s-streams[stream_id_plus1 - 1]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avi: Validate sample_size
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Wed May 6 02:26:57 2015 +0200| [a55a70644872027fdf76a75edf12a09c9008880f] | committer: Vittorio Giovara avi: Validate sample_size And either error out or set it to 0 if it is negative. CC: libav-sta...@libav.org Signed-off-by: Luca Barbato lu_z...@gentoo.org http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a55a70644872027fdf76a75edf12a09c9008880f --- libavformat/avidec.c | 17 + 1 file changed, 17 insertions(+) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index c24a6c4..54c4814 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -569,6 +569,23 @@ static int avi_read_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, unknown stream type %X\n, tag1); goto fail; } + +if (ast-sample_size 0) { +if (s-error_recognition AV_EF_EXPLODE) { +av_log(s, AV_LOG_ERROR, + Invalid sample_size %d at stream %d\n, + ast-sample_size, + stream_index); +goto fail; +} +av_log(s, AV_LOG_WARNING, + Invalid sample_size %d at stream %d + setting it to 0\n, + ast-sample_size, + stream_index); +ast-sample_size = 0; +} + if (ast-sample_size == 0) st-duration = st-nb_frames; ast-frame_offset = ast-cum_len; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avidec: avoid infinite loop due to negative ast-sample_size
ffmpeg | branch: release/2.4 | Andreas Cadhalpun andreas.cadhal...@googlemail.com | Mon May 4 23:01:45 2015 +0200| [df0003030a979d7790180b3aa7e265e6f2b2fb1c] | committer: Michael Niedermayer avidec: avoid infinite loop due to negative ast-sample_size If max in clean_index is set to a negative ast-sample_size, the following loop never ends: while (max 1024) max += max; Thus set ast-sample_size to 0 if it would otherwise be negative. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit ca234639ac49a0dc073ac1f10977979acdb94f97) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df0003030a979d7790180b3aa7e265e6f2b2fb1c --- libavformat/avidec.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index a73bf98..d6dea6e 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -685,6 +685,7 @@ static int avi_read_header(AVFormatContext *s) default: av_log(s, AV_LOG_INFO, unknown stream type %X\n, tag1); } +ast-sample_size = FFMAX(ast-sample_size, 0); if (ast-sample_size == 0) { st-duration = st-nb_frames; if (st-duration 0 avi-io_fsize 0 avi-riff_end avi-io_fsize) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/avidec: print a warning for negative sample_size
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Mon May 4 23:42:24 2015 +0200| [9f4979b24c9a455b1ef16ee97dfeb21e4cfde1ba] | committer: Michael Niedermayer avformat/avidec: print a warning for negative sample_size Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit c7369f3a4bd21ea64571c1b0c4fcbf39f8daf68c) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f4979b24c9a455b1ef16ee97dfeb21e4cfde1ba --- libavformat/avidec.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index d6dea6e..8c638de 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -685,6 +685,8 @@ static int avi_read_header(AVFormatContext *s) default: av_log(s, AV_LOG_INFO, unknown stream type %X\n, tag1); } +if (ast-sample_size 0) +av_log(s, AV_LOG_WARNING, sample size %d is invalid\n, ast-sample_size); ast-sample_size = FFMAX(ast-sample_size, 0); if (ast-sample_size == 0) { st-duration = st-nb_frames; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'cb5324200ccdc693dd5b28dcd7d4b722fad83ea2' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 21:19:35 2015 +0200| [2070149cbbf853e78efdada52ebdc8e958564f14] | committer: Michael Niedermayer Merge commit 'cb5324200ccdc693dd5b28dcd7d4b722fad83ea2' into release/2.4 * commit 'cb5324200ccdc693dd5b28dcd7d4b722fad83ea2': alac: Reject rice_limit 0 if compression is used Conflicts: libavcodec/alac.c See: 4b657a1b1eedcf38bcf36e89a2f4be6f76b5ce09 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2070149cbbf853e78efdada52ebdc8e958564f14 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'a55a70644872027fdf76a75edf12a09c9008880f' into release/2.4
ffmpeg | branch: release/2.4 | Michael Niedermayer michae...@gmx.at | Tue May 19 21:24:39 2015 +0200| [9005075f397bc7bd2fa2e193f62cbf971bdaa4d4] | committer: Michael Niedermayer Merge commit 'a55a70644872027fdf76a75edf12a09c9008880f' into release/2.4 * commit 'a55a70644872027fdf76a75edf12a09c9008880f': avi: Validate sample_size Conflicts: libavformat/avidec.c See: ca234639ac49a0dc073ac1f10977979acdb94f97 See: c7369f3a4bd21ea64571c1b0c4fcbf39f8daf68c Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9005075f397bc7bd2fa2e193f62cbf971bdaa4d4 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog