[FFmpeg-cvslog] Bump for psd demuxer and decoder

2016-12-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Dec 14 11:36:26 2016 +0100| [457e9339196450586113f5418a821fe85f859038] | 
committer: Michael Niedermayer

Bump for psd demuxer and decoder

Found-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

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

 libavcodec/version.h  | 2 +-
 libavformat/version.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/version.h b/libavcodec/version.h
index 625f947..3354d7f 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  57
-#define LIBAVCODEC_VERSION_MINOR  67
+#define LIBAVCODEC_VERSION_MINOR  68
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavformat/version.h b/libavformat/version.h
index 192b790..b68ab51 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  59
+#define LIBAVFORMAT_VERSION_MINOR  60
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

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


[FFmpeg-cvslog] Add missing #includes for standalone spherical-information-related headers

2016-12-14 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Dec  8 
19:47:58 2016 +0100| [2d7aadf3d95c96848433955b537ced415fb6ae20] | committer: 
James Almer

Add missing #includes for standalone spherical-information-related headers

(cherry picked from commit f912fd767e55bbb5a1554bd99bacab007659609c)
Signed-off-by: James Almer 

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

 libavformat/isom.h| 3 +++
 libavutil/spherical.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 0fd9eb0..12cefc9 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -24,6 +24,9 @@
 #ifndef AVFORMAT_ISOM_H
 #define AVFORMAT_ISOM_H
 
+#include 
+#include 
+
 #include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
 
diff --git a/libavutil/spherical.h b/libavutil/spherical.h
index 0a669da..eeda625 100644
--- a/libavutil/spherical.h
+++ b/libavutil/spherical.h
@@ -26,6 +26,9 @@
 #ifndef AVUTIL_SPHERICAL_H
 #define AVUTIL_SPHERICAL_H
 
+#include 
+#include 
+
 /**
  * @addtogroup lavu_video
  * @{

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


[FFmpeg-cvslog] doc/filters: drawtext: add example of printing texts on same baseline

2016-12-14 Thread Andrey Utkin
ffmpeg | branch: master | Andrey Utkin  | Wed Dec 14 
14:37:47 2016 +| [c4afd4abce58bc3c25fd2964ae9d2a38dec5dc99] | committer: 
Lou Logan

doc/filters: drawtext: add example of printing texts on same baseline

Height of canvas produced by drawtext varies depending on symbols in
text, so add example for printing separate texts aligned horizontally.

Wording suggested by Lou Logan 

Signed-off-by: Andrey Utkin 
Signed-off-by: Lou Logan 

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

 doc/filters.texi | 8 
 1 file changed, 8 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index 3ae3c46..06ca2e0 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7135,6 +7135,14 @@ FOD=5 # fade out duration
 ffplay -f lavfi 
"color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff%@{eif:
 clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - 
$DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE 
- $FOD\\, $DE) )\\, 0\\, 255) : x: 2 @}"
 @end example
 
+@item
+Horizontally align multiple separate texts. Note that @option{max_glyph_a}
+and the @option{fontsize} value are included in the @option{y} offset.
+@example
+drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
+drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
+@end example
+
 @end itemize
 
 For more information about libfreetype, check:

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


[FFmpeg-cvslog] doc/filters: fix channel names in sofalizer example

2016-12-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Dec 14 22:48:53 
2016 +0100| [e54b61a9ce19aa532e176869e8fcfc955dca6222] | committer: Paul B Mahol

doc/filters: fix channel names in sofalizer example

Signed-off-by: Paul B Mahol 

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

 doc/filters.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 06ca2e0..51db7f9 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3511,10 +3511,10 @@ 
sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
 @end example
 
 @item
-Similar as above but with custom speaker positions for front left, front 
right, rear left and rear right
+Similar as above but with custom speaker positions for front left, front 
right, back left and back right
 and also with custom gain:
 @example
-"sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 
315|RL 135|RR 225:gain=28"
+"sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 
315|BL 135|BR 225:gain=28"
 @end example
 @end itemize
 

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


[FFmpeg-cvslog] avfilter/af_sofalizer: warn if user gives unknown channel names

2016-12-14 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Dec 14 22:47:38 
2016 +0100| [458fbee22154bd01b2d8f93ad7ff76ac63bbc32e] | committer: Paul B Mahol

avfilter/af_sofalizer: warn if user gives unknown channel names

Signed-off-by: Paul B Mahol 

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

 libavfilter/af_sofalizer.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 7558f57..400b3c7 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -373,9 +373,8 @@ error:
 return ret;
 }
 
-static int parse_channel_name(char **arg, int *rchannel)
+static int parse_channel_name(char **arg, int *rchannel, char *buf)
 {
-char buf[8];
 int len, i, channel_id = 0;
 int64_t layout, layout0;
 
@@ -409,12 +408,15 @@ static void parse_speaker_pos(AVFilterContext *ctx, 
int64_t in_channel_layout)
 p = args;
 
 while ((arg = av_strtok(p, "|", &tokenizer))) {
+char buf[8];
 float azim, elev;
 int out_ch_id;
 
 p = NULL;
-if (parse_channel_name(&arg, &out_ch_id))
+if (parse_channel_name(&arg, &out_ch_id, buf)) {
+av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel 
name.\n", buf);
 continue;
+}
 if (sscanf(arg, "%f %f", &azim, &elev) == 2) {
 s->vspkrpos[out_ch_id].set = 1;
 s->vspkrpos[out_ch_id].azim = azim;

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


[FFmpeg-cvslog] 4xm: prevent overflow during bit rate calculation

2016-12-14 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Wed Dec 14 01:53:14 2016 +0100| [e558a6348ac10e74c54fb50ffd783ff9b5aec050] | 
committer: Andreas Cadhalpun

4xm: prevent overflow during bit rate calculation

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 

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

 libavformat/4xm.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 8a50778..2758b69 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -163,6 +163,12 @@ static int parse_strk(AVFormatContext *s,
 return AVERROR_INVALIDDATA;
 }
 
+if (fourxm->tracks[track].sample_rate > INT64_MAX / 
fourxm->tracks[track].bits / fourxm->tracks[track].channels) {
+av_log(s, AV_LOG_ERROR, "Overflow during bit rate calculation %d * %d 
* %d\n",
+   fourxm->tracks[track].sample_rate, fourxm->tracks[track].bits, 
fourxm->tracks[track].channels);
+return AVERROR_INVALIDDATA;
+}
+
 /* allocate a new AVStream */
 st = avformat_new_stream(s, NULL);
 if (!st)
@@ -178,7 +184,7 @@ static int parse_strk(AVFormatContext *s,
 st->codecpar->channels  = fourxm->tracks[track].channels;
 st->codecpar->sample_rate   = fourxm->tracks[track].sample_rate;
 st->codecpar->bits_per_coded_sample = fourxm->tracks[track].bits;
-st->codecpar->bit_rate  = st->codecpar->channels *
+st->codecpar->bit_rate  = (int64_t)st->codecpar->channels *
   st->codecpar->sample_rate *
   st->codecpar->bits_per_coded_sample;
 st->codecpar->block_align   = st->codecpar->channels *

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


[FFmpeg-cvslog] cafdec: prevent overflow during bit rate calculation

2016-12-14 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Wed Dec 14 01:53:19 2016 +0100| [baba9c6aef88727bb0182631dc67744d36cadea4] | 
committer: Andreas Cadhalpun

cafdec: prevent overflow during bit rate calculation

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 

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

 libavformat/cafdec.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 1c4ca40..0e6179a 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -323,8 +323,13 @@ static int read_header(AVFormatContext *s)
 if (caf->data_size > 0)
 st->nb_frames = (caf->data_size / caf->bytes_per_packet) * 
caf->frames_per_packet;
 } else if (st->nb_index_entries && st->duration > 0) {
-st->codecpar->bit_rate = st->codecpar->sample_rate * caf->data_size * 
8 /
- st->duration;
+if (st->codecpar->sample_rate && caf->data_size / st->duration > 
INT64_MAX / st->codecpar->sample_rate / 8) {
+av_log(s, AV_LOG_ERROR, "Overflow during bit rate calculation %d * 
8 * %"PRId64"\n",
+   st->codecpar->sample_rate, caf->data_size / st->duration);
+return AVERROR_INVALIDDATA;
+}
+st->codecpar->bit_rate = st->codecpar->sample_rate * 8LL *
+ (caf->data_size / st->duration);
 } else {
 av_log(s, AV_LOG_ERROR, "Missing packet table. It is required when "
 "block size or frame size are variable.\n");

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


[FFmpeg-cvslog] mov: prevent overflow during bit rate calculation

2016-12-14 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Wed Dec 14 01:53:23 2016 +0100| [076c3a9fa23ca2b0dd167a087ab1e4fb4357a31b] | 
committer: Andreas Cadhalpun

mov: prevent overflow during bit rate calculation

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6c8affc..fc0b25c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5887,8 +5887,15 @@ static int mov_read_header(AVFormatContext *s)
 for (i = 0; i < s->nb_streams; i++) {
 AVStream *st = s->streams[i];
 MOVStreamContext *sc = st->priv_data;
-if (st->duration > 0)
+if (st->duration > 0) {
+if (sc->data_size > INT64_MAX / sc->time_scale / 8) {
+av_log(s, AV_LOG_ERROR, "Overflow during bit rate 
calculation %"PRId64" * 8 * %d\n",
+   sc->data_size, sc->time_scale);
+mov_read_close(s);
+return AVERROR_INVALIDDATA;
+}
 st->codecpar->bit_rate = sc->data_size * 8 * sc->time_scale / 
st->duration;
+}
 }
 }
 
@@ -5897,6 +5904,12 @@ static int mov_read_header(AVFormatContext *s)
 AVStream *st = s->streams[i];
 MOVStreamContext *sc = st->priv_data;
 if (sc->duration_for_fps > 0) {
+if (sc->data_size > INT64_MAX / sc->time_scale / 8) {
+av_log(s, AV_LOG_ERROR, "Overflow during bit rate 
calculation %"PRId64" * 8 * %d\n",
+   sc->data_size, sc->time_scale);
+mov_read_close(s);
+return AVERROR_INVALIDDATA;
+}
 st->codecpar->bit_rate = sc->data_size * 8 * sc->time_scale /
 sc->duration_for_fps;
 }

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


[FFmpeg-cvslog] tiff: fix overflows when calling av_reduce

2016-12-14 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Tue Dec 13 00:43:21 2016 +0100| [ed412d285078c167a3a5326bcb16b2169b488943] | 
committer: Andreas Cadhalpun

tiff: fix overflows when calling av_reduce

The arguments of av_reduce are signed, so the cast to uint64_t is misleading.

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 

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

 libavcodec/tiff.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 4721e94..7ccda51 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -772,9 +772,18 @@ static void set_sar(TiffContext *s, unsigned tag, unsigned 
num, unsigned den)
 int offset = tag == TIFF_YRES ? 2 : 0;
 s->res[offset++] = num;
 s->res[offset]   = den;
-if (s->res[0] && s->res[1] && s->res[2] && s->res[3])
+if (s->res[0] && s->res[1] && s->res[2] && s->res[3]) {
+uint64_t num = s->res[2] * (uint64_t)s->res[1];
+uint64_t den = s->res[0] * (uint64_t)s->res[3];
+if (num > INT64_MAX || den > INT64_MAX) {
+num = num >> 1;
+den = den >> 1;
+}
 av_reduce(&s->avctx->sample_aspect_ratio.num, 
&s->avctx->sample_aspect_ratio.den,
-  s->res[2] * (uint64_t)s->res[1], s->res[0] * 
(uint64_t)s->res[3], INT32_MAX);
+  num, den, INT32_MAX);
+if (!s->avctx->sample_aspect_ratio.den)
+s->avctx->sample_aspect_ratio = (AVRational) {0, 1};
+}
 }
 
 static int tiff_decode_tag(TiffContext *s, AVFrame *frame)

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


[FFmpeg-cvslog] avformat/mp3dec: fix msan warning when verifying mpa header

2016-12-14 Thread Chris Cunningham
ffmpeg | branch: master | Chris Cunningham  | Tue 
Nov 22 13:54:50 2016 -0800| [ab87df9a47cd31bfcae9acd84c04705a149dfc14] | 
committer: Michael Niedermayer

avformat/mp3dec: fix msan warning when verifying mpa header

MPEG Audio frame header must be 4 bytes. If we fail to read
4 bytes bail early to avoid Use-of-uninitialized-value msan error.
Reference https://crbug.com/666874.

Signed-off-by: Michael Niedermayer 

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

 libavformat/mp3dec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 56c7f8c..099ca57 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -457,7 +457,8 @@ static int check(AVIOContext *pb, int64_t pos, uint32_t 
*ret_header)
 return CHECK_SEEK_FAILED;
 
 ret = avio_read(pb, &header_buf[0], 4);
-if (ret < 0)
+/* We should always find four bytes for a valid mpa header. */
+if (ret < 4)
 return CHECK_SEEK_FAILED;
 
 header = AV_RB32(&header_buf[0]);

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