[FFmpeg-cvslog] lavf/matroskadec: fix is_keyframe for early Blocks

2017-02-06 Thread Chris Cunningham
ffmpeg | branch: master | Chris Cunningham  | Fri 
Feb  3 14:42:44 2017 -0800| [ac25840ee32888f0c13118edeb9404a123cd3a79] | 
committer: wm4

lavf/matroskadec: fix is_keyframe for early Blocks

Blocks are marked as key frames whenever the "reference" field is
zero. This breaks for non-keyframe Blocks with a reference timestamp
of zero.

The likelihood of reference timestamp being zero is increased by a
longstanding bug in muxing that encodes reference timestamp as the
absolute time of the referenced frame (rather than relative to the
current Block timestamp, as described in MKV spec).

Now using INT64_MIN to denote "no reference".

Reported to chromium at http://crbug.com/497889 (contains sample)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac25840ee32888f0c13118edeb9404a123cd3a79
---

 libavformat/matroskadec.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e6737a7..7223e94 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -89,6 +89,7 @@ typedef const struct EbmlSyntax {
 int list_elem_size;
 int data_offset;
 union {
+int64_t i;
 uint64_tu;
 double  f;
 const char *s;
@@ -696,7 +697,7 @@ static const EbmlSyntax matroska_blockgroup[] = {
 { MATROSKA_ID_SIMPLEBLOCK,EBML_BIN,  0, offsetof(MatroskaBlock, bin) },
 { MATROSKA_ID_BLOCKDURATION,  EBML_UINT, 0, offsetof(MatroskaBlock, 
duration) },
 { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock, 
discard_padding) },
-{ MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, 
reference) },
+{ MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, 
reference), { .i = INT64_MIN } },
 { MATROSKA_ID_CODECSTATE, EBML_NONE },
 {  1, EBML_UINT, 0, offsetof(MatroskaBlock, 
non_simple), { .u = 1 } },
 { 0 }
@@ -1071,6 +1072,9 @@ static int ebml_parse_nest(MatroskaDemuxContext 
*matroska, EbmlSyntax *syntax,
 
 for (i = 0; syntax[i].id; i++)
 switch (syntax[i].type) {
+case EBML_SINT:
+*(int64_t *) ((char *) data + syntax[i].data_offset) = 
syntax[i].def.i;
+break;
 case EBML_UINT:
 *(uint64_t *) ((char *) data + syntax[i].data_offset) = 
syntax[i].def.u;
 break;
@@ -3361,7 +3365,7 @@ static int 
matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
 matroska->current_cluster_num_blocks = blocks_list->nb_elem;
 i= blocks_list->nb_elem - 1;
 if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
-int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
+int is_keyframe = blocks[i].non_simple ? blocks[i].reference == 
INT64_MIN : -1;
 uint8_t* additional = blocks[i].additional.size > 0 ?
 blocks[i].additional.data : NULL;
 if (!blocks[i].non_simple)
@@ -3399,7 +3403,7 @@ static int matroska_parse_cluster(MatroskaDemuxContext 
*matroska)
 blocks  = blocks_list->elem;
 for (i = 0; i < blocks_list->nb_elem; i++)
 if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
-int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
+int is_keyframe = blocks[i].non_simple ? blocks[i].reference == 
INT64_MIN : -1;
 res = matroska_parse_block(matroska, blocks[i].bin.data,
blocks[i].bin.size, blocks[i].bin.pos,
cluster.timecode, blocks[i].duration,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/mjpegdec: Check for for the bitstream end in mjpeg_decode_scan_progressive_ac()

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Wed Feb  1 01:32:37 2017 +0100| [aa20863f4400a25bdbac36df94cdcb6e759a1c2b] | 
committer: Michael Niedermayer

avcodec/mjpegdec: Check for for the bitstream end in 
mjpeg_decode_scan_progressive_ac()

Fixes timeout
Fixes: 496/clusterfuzz-testcase-5805083497332736

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 3782656631fa8262528c07794acf7e9c2aab000d)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa20863f4400a25bdbac36df94cdcb6e759a1c2b
---

 libavcodec/mjpegdec.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 1858b45..4f23fc9 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1397,6 +1397,10 @@ static int 
mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
 int block_idx= mb_y * s->block_stride[c];
 int16_t (*block)[64] = &s->blocks[c][block_idx];
 uint8_t *last_nnz= &s->last_nnz[c][block_idx];
+if (get_bits_left(&s->gb) <= 0) {
+av_log(s->avctx, AV_LOG_ERROR, "bitstream truncated in 
mjpeg_decode_scan_progressive_ac\n");
+return AVERROR_INVALIDDATA;
+}
 for (mb_x = 0; mb_x < s->mb_width; mb_x++, block++, last_nnz++) {
 int ret;
 if (s->restart_interval && !s->restart_count)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] configure: bump year

2017-02-06 Thread James Almer
ffmpeg | branch: release/3.2 | James Almer  | Mon Jan  2 
01:38:03 2017 -0300| [87a47c67a6973a76996a43e4112926cdb6d29f74] | committer: 
Michael Niedermayer

configure: bump year

Happy new year!

(cherry picked from commit d800d48fc67208819c2a4ae5eb214ca5e3ad7e82)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87a47c67a6973a76996a43e4112926cdb6d29f74
---

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index d60ffd8..a1818dc 100755
--- a/configure
+++ b/configure
@@ -6703,7 +6703,7 @@ cat > $TMPH 

[FFmpeg-cvslog] avcodec/pngdec: Check trns more completely

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Sat Feb  4 12:24:14 2017 +0100| [7e1d9d25fe0494403f438c4487d5e2ab4a2bbac0] | 
committer: Michael Niedermayer

avcodec/pngdec: Check trns more completely

Fixes out of array access
Fixes: 546/clusterfuzz-testcase-4809433909559296

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit e477f09d0b3619f3d29173b2cd593e17e2d1978e)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e1d9d25fe0494403f438c4487d5e2ab4a2bbac0
---

 libavcodec/pngdec.c | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 7ade0ce..bf8f27f 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -772,6 +772,16 @@ static int decode_trns_chunk(AVCodecContext *avctx, 
PNGDecContext *s,
 {
 int v, i;
 
+if (!(s->state & PNG_IHDR)) {
+av_log(avctx, AV_LOG_ERROR, "trns before IHDR\n");
+return AVERROR_INVALIDDATA;
+}
+
+if (s->state & PNG_IDAT) {
+av_log(avctx, AV_LOG_ERROR, "trns after IDAT\n");
+return AVERROR_INVALIDDATA;
+}
+
 if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
 if (length > 256 || !(s->state & PNG_PLTE))
 return AVERROR_INVALIDDATA;
@@ -782,7 +792,8 @@ static int decode_trns_chunk(AVCodecContext *avctx, 
PNGDecContext *s,
 }
 } else if (s->color_type == PNG_COLOR_TYPE_GRAY || s->color_type == 
PNG_COLOR_TYPE_RGB) {
 if ((s->color_type == PNG_COLOR_TYPE_GRAY && length != 2) ||
-(s->color_type == PNG_COLOR_TYPE_RGB && length != 6))
+(s->color_type == PNG_COLOR_TYPE_RGB && length != 6) ||
+s->bit_depth == 1)
 return AVERROR_INVALIDDATA;
 
 for (i = 0; i < length / 2; i++) {
@@ -1241,6 +1252,8 @@ exit_loop:
 size_t raw_bpp = s->bpp - byte_depth;
 unsigned x, y;
 
+av_assert0(s->bit_depth > 1);
+
 for (y = 0; y < s->height; ++y) {
 uint8_t *row = &s->image_buf[s->image_linesize * y];
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/dca_lbr: Fix off by 1 error in freq check

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Thu Feb  2 15:23:31 2017 +0100| [7323a8ab2970d4b7c9b5a96738e4bf82c90459b1] | 
committer: Michael Niedermayer

avcodec/dca_lbr: Fix off by 1 error in freq check

Fixes out of array read
Fixes: 510/clusterfuzz-testcase-5737865715646464

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 61f70416f8542cc86c84ae6e0342ba10a35d7cba)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7323a8ab2970d4b7c9b5a96738e4bf82c90459b1
---

 libavcodec/dca_lbr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c
index 342603c..56c5f40 100644
--- a/libavcodec/dca_lbr.c
+++ b/libavcodec/dca_lbr.c
@@ -310,7 +310,7 @@ static int parse_tonal(DCALbrDecoder *s, int group)
 break;  // End of subframe
 
 freq += diff - 2;
-if (freq >> (5 - group) > s->nsubbands * 4 - 5) {
+if (freq >> (5 - group) > s->nsubbands * 4 - 6) {
 av_log(s->avctx, AV_LOG_ERROR, "Invalid spectral line 
offset\n");
 return -1;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/interplayvideo: Move parameter change check up

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Sat Feb  4 02:45:02 2017 +0100| [d399f25bd1e62c6cb41f40b74ebdf65310e3f3ce] | 
committer: Michael Niedermayer

avcodec/interplayvideo: Move parameter change check up

Fixes out of array read
Fixes: 
544/clusterfuzz-testcase-5936536407244800.f8bd9b24_8ba77916_70c2c7be_3df6a2ea_96cd9f14

Signed-off-by: Michael Niedermayer 
(cherry picked from commit b1e2192007d7026049237c9ab11e05ae71bf4f42)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d399f25bd1e62c6cb41f40b74ebdf65310e3f3ce
---

 libavcodec/interplayvideo.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index abfc935..8d2f3ab 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -989,6 +989,11 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
 AVFrame *frame = data;
 int ret;
 
+if (av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, NULL)) {
+av_frame_unref(s->last_frame);
+av_frame_unref(s->second_last_frame);
+}
+
 if (buf_size < 2)
 return AVERROR_INVALIDDATA;
 
@@ -1000,10 +1005,6 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
 if (buf_size < s->decoding_map_size + 2)
 return buf_size;
 
-if (av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, NULL)) {
-av_frame_unref(s->last_frame);
-av_frame_unref(s->second_last_frame);
-}
 
 s->decoding_map = buf + 2;
 bytestream2_init(&s->stream_ptr, buf + 2 + s->decoding_map_size,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avfilter/vf_midequalizer: Remove duplicate include

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon 
Feb  6 01:53:56 2017 +0100| [4fcdc9f3597289942de993f86caaf1d1b17057d9] | 
committer: Michael Niedermayer

avfilter/vf_midequalizer: Remove duplicate include

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4fcdc9f3597289942de993f86caaf1d1b17057d9
---

 libavfilter/vf_midequalizer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavfilter/vf_midequalizer.c b/libavfilter/vf_midequalizer.c
index 3a15576..b95a86d 100644
--- a/libavfilter/vf_midequalizer.c
+++ b/libavfilter/vf_midequalizer.c
@@ -25,7 +25,6 @@
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
-#include "avfilter.h"
 #include "framesync.h"
 
 typedef struct MidEqualizerContext {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/movtextdec: Fix decode_styl() cleanup

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon 
Feb  6 11:17:10 2017 +0100| [e248522d1b0d6dd8641f382cd5c4338d0ecd98e5] | 
committer: Michael Niedermayer

avcodec/movtextdec: Fix decode_styl() cleanup

Fixes: null pointer dereference
Fixes: 555/clusterfuzz-testcase-5986646595993600

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e248522d1b0d6dd8641f382cd5c4338d0ecd98e5
---

 libavcodec/movtextdec.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 7b5b161..81fd1d6 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -116,6 +116,8 @@ static void mov_text_cleanup(MovTextContext *m)
 av_freep(&m->s[i]);
 }
 av_freep(&m->s);
+m->count_s = 0;
+m->style_entries = 0;
 }
 }
 
@@ -279,12 +281,14 @@ static int decode_hclr(const uint8_t *tsmb, 
MovTextContext *m, AVPacket *avpkt)
 static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
 {
 int i;
-m->style_entries = AV_RB16(tsmb);
+int style_entries = AV_RB16(tsmb);
 tsmb += 2;
 // A single style record is of length 12 bytes.
-if (m->tracksize + m->size_var + 2 + m->style_entries * 12 > avpkt->size)
+if (m->tracksize + m->size_var + 2 + style_entries * 12 > avpkt->size)
 return -1;
 
+m->style_entries = style_entries;
+
 m->box_flags |= STYL_BOX;
 for(i = 0; i < m->style_entries; i++) {
 m->s_temp = av_malloc(sizeof(*m->s_temp));

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/movtextdec: Fix decode_styl() cleanup

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Mon Feb  6 11:17:10 2017 +0100| [44ce16b7f90e8f6dc08099f6ea092760d90644fa] | 
committer: Michael Niedermayer

avcodec/movtextdec: Fix decode_styl() cleanup

Fixes: null pointer dereference
Fixes: 555/clusterfuzz-testcase-5986646595993600

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit e248522d1b0d6dd8641f382cd5c4338d0ecd98e5)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=44ce16b7f90e8f6dc08099f6ea092760d90644fa
---

 libavcodec/movtextdec.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 7b5b161..81fd1d6 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -116,6 +116,8 @@ static void mov_text_cleanup(MovTextContext *m)
 av_freep(&m->s[i]);
 }
 av_freep(&m->s);
+m->count_s = 0;
+m->style_entries = 0;
 }
 }
 
@@ -279,12 +281,14 @@ static int decode_hclr(const uint8_t *tsmb, 
MovTextContext *m, AVPacket *avpkt)
 static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
 {
 int i;
-m->style_entries = AV_RB16(tsmb);
+int style_entries = AV_RB16(tsmb);
 tsmb += 2;
 // A single style record is of length 12 bytes.
-if (m->tracksize + m->size_var + 2 + m->style_entries * 12 > avpkt->size)
+if (m->tracksize + m->size_var + 2 + style_entries * 12 > avpkt->size)
 return -1;
 
+m->style_entries = style_entries;
+
 m->box_flags |= STYL_BOX;
 for(i = 0; i < m->style_entries; i++) {
 m->s_temp = av_malloc(sizeof(*m->s_temp));

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavf/matroskadec: fix is_keyframe for early Blocks

2017-02-06 Thread Chris Cunningham
ffmpeg | branch: release/3.2 | Chris Cunningham  | 
Fri Feb  3 14:42:44 2017 -0800| [d88493c02b4af3b6c02adb958485250ebd477633] | 
committer: Michael Niedermayer

lavf/matroskadec: fix is_keyframe for early Blocks

Blocks are marked as key frames whenever the "reference" field is
zero. This breaks for non-keyframe Blocks with a reference timestamp
of zero.

The likelihood of reference timestamp being zero is increased by a
longstanding bug in muxing that encodes reference timestamp as the
absolute time of the referenced frame (rather than relative to the
current Block timestamp, as described in MKV spec).

Now using INT64_MIN to denote "no reference".

Reported to chromium at http://crbug.com/497889 (contains sample)

(cherry picked from commit ac25840ee32888f0c13118edeb9404a123cd3a79)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d88493c02b4af3b6c02adb958485250ebd477633
---

 libavformat/matroskadec.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 130d92e..fe23f39 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -88,6 +88,7 @@ typedef const struct EbmlSyntax {
 int list_elem_size;
 int data_offset;
 union {
+int64_t i;
 uint64_tu;
 double  f;
 const char *s;
@@ -676,7 +677,7 @@ static const EbmlSyntax matroska_blockgroup[] = {
 { MATROSKA_ID_SIMPLEBLOCK,EBML_BIN,  0, offsetof(MatroskaBlock, bin) },
 { MATROSKA_ID_BLOCKDURATION,  EBML_UINT, 0, offsetof(MatroskaBlock, 
duration) },
 { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock, 
discard_padding) },
-{ MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, 
reference) },
+{ MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, 
reference), { .i = INT64_MIN } },
 { MATROSKA_ID_CODECSTATE, EBML_NONE },
 {  1, EBML_UINT, 0, offsetof(MatroskaBlock, 
non_simple), { .u = 1 } },
 { 0 }
@@ -1051,6 +1052,9 @@ static int ebml_parse_nest(MatroskaDemuxContext 
*matroska, EbmlSyntax *syntax,
 
 for (i = 0; syntax[i].id; i++)
 switch (syntax[i].type) {
+case EBML_SINT:
+*(int64_t *) ((char *) data + syntax[i].data_offset) = 
syntax[i].def.i;
+break;
 case EBML_UINT:
 *(uint64_t *) ((char *) data + syntax[i].data_offset) = 
syntax[i].def.u;
 break;
@@ -3289,7 +3293,7 @@ static int 
matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
 matroska->current_cluster_num_blocks = blocks_list->nb_elem;
 i= blocks_list->nb_elem - 1;
 if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
-int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
+int is_keyframe = blocks[i].non_simple ? blocks[i].reference == 
INT64_MIN : -1;
 uint8_t* additional = blocks[i].additional.size > 0 ?
 blocks[i].additional.data : NULL;
 if (!blocks[i].non_simple)
@@ -3327,7 +3331,7 @@ static int matroska_parse_cluster(MatroskaDemuxContext 
*matroska)
 blocks  = blocks_list->elem;
 for (i = 0; i < blocks_list->nb_elem; i++)
 if (blocks[i].bin.size > 0 && blocks[i].bin.data) {
-int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
+int is_keyframe = blocks[i].non_simple ? blocks[i].reference == 
INT64_MIN : -1;
 res = matroska_parse_block(matroska, blocks[i].bin.data,
blocks[i].bin.size, blocks[i].bin.pos,
cluster.timecode, blocks[i].duration,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Update for 3.2.3

2017-02-06 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Mon Feb  6 12:26:47 2017 +0100| [68ed682710f1cb1f4fdd1fd0447f402d6feabd01] | 
committer: Michael Niedermayer

Update for 3.2.3

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=68ed682710f1cb1f4fdd1fd0447f402d6feabd01
---

 Changelog| 37 +
 RELEASE  |  2 +-
 doc/Doxyfile |  2 +-
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 4741944..10f95f6 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,43 @@
 Entries are sorted chronologically from oldest to youngest within each release,
 releases are sorted from youngest to oldest.
 
+version 3.2.3:
+- avcodec/movtextdec: Fix decode_styl() cleanup
+- lavf/matroskadec: fix is_keyframe for early Blocks
+- configure: bump year
+- avcodec/pngdec: Check trns more completely
+- avcodec/interplayvideo: Move parameter change check up
+- avcodec/dca_lbr: Fix off by 1 error in freq check
+- avcodec/mjpegdec: Check for for the bitstream end in 
mjpeg_decode_scan_progressive_ac()
+- pgssubdec: reset rle_data_len/rle_remaining_len on allocation error
+- swscale: save ebx register when it is not available
+- avformat/flacdec: Check avio_read result when reading flac block header.
+- avcodec/utils: correct align value for interplay
+- avcodec/vp56: Check for the bitstream end, pass error codes on
+- avcodec/mjpegdec: Check remaining bitstream in ljpeg_decode_yuv_scan()
+- avcodec/pngdec: Fix off by 1 size in decode_zbuf()
+- libopenmpt: add missing avio_read return value check
+- avcodec/bsf: Fix av_bsf_list_free()
+- avcodec/omx: Do not pass negative value into av_malloc()
+- avformat/avidec: skip odml master index chunks in avi_sync
+- avcodec/mjpegdec: Check for rgb before flipping
+- lavf/utils.c Protect against accessing entries[nb_entries]
+- avutil/random_seed: Reduce the time needed on systems with very low 
precission clock()
+- swscale/swscale: Fix dereference of stride array before null check
+- avutil/random_seed: Improve get_generic_seed() with higher precission clock()
+- avformat/mp3dec: fix msan warning when verifying mpa header
+- avformat/utils: Print verbose error message if stream count exceeds 
max_streams
+- avformat/options_table: Set the default maximum number of streams to 1000
+- lavf/chromaprint: Update for version 1.4
+- avutil: Add av_image_check_size2()
+- avformat: Add max_streams option
+- avcodec/ffv1enc: Allocate smaller packet if the worst case size cannot be 
allocated
+- avcodec/mpeg4videodec: Fix undefined shifts in 
mpeg4_decode_sprite_trajectory()
+- avformat/oggdec: Skip streams in duration correction that did not had their 
duration set.
+- avcodec/ffv1enc: Fix size of first slice
+- ffplay: fix sws_scale possible out of bounds array access
+- avfilter/vf_hwupload_cuda: Add min/max limits for the 'device' option
+
 version 3.2.2:
 - ffserver: Check chunk size
 - Avoid using the term "file" and prefer "url" in some docs and comments
diff --git a/RELEASE b/RELEASE
index be94e6f..b347b11 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-3.2.2
+3.2.3
diff --git a/doc/Doxyfile b/doc/Doxyfile
index f4ea7bf..367a2d0 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME   = FFmpeg
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER = 3.2.2
+PROJECT_NUMBER = 3.2.3
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Tag n3.2.3 : FFmpeg 3.2.3 release

2017-02-06 Thread git
[ffmpeg] [branch: refs/tags/n3.2.3]
Tag:b4c2500cd2c92e9c1cf2fac293723bf11c696e0d
> http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=b4c2500cd2c92e9c1cf2fac293723bf11c696e0d

Tagger: Michael Niedermayer 
Date:   Mon Feb  6 18:50:08 2017 +0100

FFmpeg 3.2.3 release
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. a90f1e0 web/download: Add FFmpeg 3.2.3

2017-02-06 Thread ffmpeg-git
The branch, master has been updated
   via  a90f1e0b4aadb733c54d4971a2ce958df56757ff (commit)
  from  eebb1a7af58de08d67a3dcb1f2bf9cf1f4ae422a (commit)


- Log -
commit a90f1e0b4aadb733c54d4971a2ce958df56757ff
Author: Michael Niedermayer 
AuthorDate: Mon Feb 6 18:54:26 2017 +0100
Commit: Michael Niedermayer 
CommitDate: Mon Feb 6 18:55:20 2017 +0100

web/download: Add FFmpeg 3.2.3

Signed-off-by: Michael Niedermayer 

diff --git a/src/download b/src/download
index 4786e1a..ab8140f 100644
--- a/src/download
+++ b/src/download
@@ -1,10 +1,10 @@
 
 
   
-http://ffmpeg.org/releases/ffmpeg-3.2.2.tar.bz2"; class="btn 
btn-success">
+http://ffmpeg.org/releases/ffmpeg-3.2.3.tar.bz2"; class="btn 
btn-success">
   
   Download
-  ffmpeg-3.2.2.tar.bz2
+  ffmpeg-3.2.3.tar.bz2
 
 
 More releases
@@ -269,11 +269,11 @@
 and much faster bug fixes such as additional features and security patches.
   
 
-  FFmpeg 3.2.2 "Hypatia"
+  FFmpeg 3.2.3 "Hypatia"
 
   
-3.2.2 was released on 2016-12-06. It is the latest stable FFmpeg release
-from the 3.2.2 release branch, which was cut from master on 2016-10-26.
+3.2.3 was released on 2017-02-06. It is the latest stable FFmpeg release
+from the 3.2.3 release branch, which was cut from master on 2016-10-26.
   
   It includes the following library versions:
   
@@ -290,19 +290,19 @@ libpostproc54.  1.100
 
   
 
-  Download 
xz tarball
-  PGP 
signature
+  Download 
xz tarball
+  PGP 
signature
  
 
-  Download 
bzip2 tarball
-  PGP 
signature
+  Download 
bzip2 tarball
+  PGP 
signature
  
 
-  Download 
gzip tarball
-  PGP 
signature
+  Download 
gzip tarball
+  PGP 
signature
  
 
-  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n3.2.2";>Changelog
+  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n3.2.3";>Changelog
   https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/refs/heads/release/3.2:/RELEASE_NOTES";>Release
 Notes
  


---

Summary of changes:
 src/download | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)


hooks/post-receive
-- 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] configure: use dashes instead of slashes in lib.exe invocation

2017-02-06 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Mon Feb  6 
19:45:54 2017 +0100| [a6cee50fa206466f7a5fe8a46f87561a403ff52f] | committer: 
Hendrik Leppkes

configure: use dashes instead of slashes in lib.exe invocation

This avoids issues with wrong parameter translation by msys on some systems,
and the Windows SDK tools accept both forms equally.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a6cee50fa206466f7a5fe8a46f87561a403ff52f
---

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 231cc3e..2755576 100755
--- a/configure
+++ b/configure
@@ -4804,7 +4804,7 @@ case $target_os in
 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
 dlltool="${cross_prefix}dlltool"
 if check_cmd lib.exe -list; then
-SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > 
$$(@:$(SLIBSUF)=.def); lib.exe /nologo /machine:$(LIBTARGET) 
/def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
+SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > 
$$(@:$(SLIBSUF)=.def); lib.exe -nologo -machine:$(LIBTARGET) 
-def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
 if enabled x86_64; then
 LIBTARGET=x64
 fi

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/hlsenc: add hls_flag option to write segments to temporary file until complete

2017-02-06 Thread Aman Gupta
ffmpeg | branch: master | Aman Gupta  | Tue Feb  7 11:58:43 2017 
+0800| [606eac7b07133b0904c2b8b4eb1dc70e1bd0c9a6] | committer: Steven Liu

avformat/hlsenc: add hls_flag option to write segments to temporary file until 
complete

Adds a `-hls_flags +temp_file` which will write segment data to
filename.tmp, and then rename to filename when the segment is complete.

This patch is similar in spirit to one used in Plex's ffmpeg fork, and
allows a transcoding webserver to ensure incomplete segment files are
never served up accidentally.

Reviewed-by: Hendrik Leppkes 
Reviewed-by: Bodecs Bela 
Signed-off-by: Aman Gupta 
Signed-off-by: Steven Liu 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=606eac7b07133b0904c2b8b4eb1dc70e1bd0c9a6
---

 doc/muxers.texi  |  5 +
 libavformat/hlsenc.c | 25 +
 2 files changed, 30 insertions(+)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index d07ae9b..cb875a4 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -656,6 +656,11 @@ Makes it possible to use segment duration (calculated  in 
microseconds) as %%t i
 expression besides date/time values when use_localtime is on.
 To get fixed width numbers with trailing zeroes, %%0xt format is available 
where x is the required width.
 
+@item temp_file
+Write segment data to filename.tmp and rename to filename only once the 
segment is complete. A webserver
+serving up segments can be configured to reject requests to *.tmp to prevent 
access to in-progress segments
+before they have been added to the m3u8 playlist.
+
 @example
 ffmpeg -i sample.mpeg \
-f hls -hls_time 3 -hls_list_size 5 \
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index bd1e684..17d4fe4 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -76,6 +76,7 @@ typedef enum HLSFlags {
 HLS_SECOND_LEVEL_SEGMENT_INDEX = (1 << 8), // include segment index in 
segment filenames when use_localtime  e.g.: %%03d
 HLS_SECOND_LEVEL_SEGMENT_DURATION = (1 << 9), // include segment duration 
(microsec) in segment filenames when use_localtime  e.g.: %%09t
 HLS_SECOND_LEVEL_SEGMENT_SIZE = (1 << 10), // include segment size (bytes) 
in segment filenames when use_localtime  e.g.: %%014s
+HLS_TEMP_FILE = (1 << 11),
 } HLSFlags;
 
 typedef enum {
@@ -416,6 +417,7 @@ static int hls_mux_init(AVFormatContext *s)
 return ret;
 oc = hls->avf;
 
+oc->filename[0]= '\0';
 oc->oformat= hls->oformat;
 oc->interrupt_callback = s->interrupt_callback;
 oc->max_delay  = s->max_delay;
@@ -815,6 +817,15 @@ static int hls_start(AVFormatContext *s)
 char *filename, iv_string[KEYSIZE*2 + 1];
 int err = 0;
 
+if ((c->flags & HLS_TEMP_FILE) && oc->filename[0] != 0) {
+size_t len = strlen(oc->filename);
+char final_filename[sizeof(oc->filename)];
+av_strlcpy(final_filename, oc->filename, len);
+final_filename[len-4] = '\0';
+ff_rename(oc->filename, final_filename, s);
+oc->filename[len-4] = '\0';
+}
+
 if (c->flags & HLS_SINGLE_FILE) {
 av_strlcpy(oc->filename, c->basename,
sizeof(oc->filename));
@@ -915,6 +926,10 @@ static int hls_start(AVFormatContext *s)
 
 set_http_options(&options, c);
 
+if (c->flags & HLS_TEMP_FILE) {
+av_strlcat(oc->filename, ".tmp", sizeof(oc->filename));
+}
+
 if (c->key_info_file) {
 if ((err = hls_encryption_start(s)) < 0)
 goto fail;
@@ -1364,6 +1379,15 @@ static int hls_write_trailer(struct AVFormatContext *s)
  ff_rename(old_filename, hls->avf->filename, hls);
 }
 
+if ((hls->flags & HLS_TEMP_FILE) && oc->filename[0] != 0) {
+size_t len = strlen(oc->filename);
+char final_filename[sizeof(oc->filename)];
+av_strlcpy(final_filename, oc->filename, len);
+final_filename[len-4] = '\0';
+ff_rename(oc->filename, final_filename, s);
+oc->filename[len-4] = '\0';
+}
+
 if (vtt_oc) {
 if (vtt_oc->pb)
 av_write_trailer(vtt_oc);
@@ -1406,6 +1430,7 @@ static const AVOption options[] = {
 {"hls_subtitle_path", "set path of hls subtitles", 
OFFSET(subtitle_filename), AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,E},
 {"hls_flags", "set flags affecting HLS playlist and media file 
generation", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, 0, UINT_MAX, E, 
"flags"},
 {"single_file",   "generate a single media file indexed with byte ranges", 
0, AV_OPT_TYPE_CONST, {.i64 = HLS_SINGLE_FILE }, 0, UINT_MAX,   E, "flags"},
+{"temp_file", "write segment to temporary file and rename when complete", 
0, AV_OPT_TYPE_CONST, {.i64 = HLS_TEMP_FILE }, 0, UINT_MAX,   E, "flags"},
 {"delete_segments", "delete segment files that are no longer part of the 
playlist", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_DELETE_SEGMENTS }, 0, UINT_MAX,   
E, "flags"},
 {"round_durations", "round durations in m3u8 to whole numbers", 0