[FFmpeg-cvslog] avformat/libopenmpt: Query duration and metadata after selecting subsong

2017-09-24 Thread Jörn Heusipp
ffmpeg | branch: master | Jörn Heusipp  | 
Sun Sep 17 15:35:50 2017 +0200| [3d2da6d585509daddcd65f206b1a262c9c78cbce] | 
committer: Josh de Kock

avformat/libopenmpt: Query duration and metadata after selecting subsong

Duration depends on the selected subsong and thus must be queried after
selecting the subsong. There is no compelling reason to query other
metadata earlier either.

Tested with libopenmpt version: 0.2.8760-beta27
Libopenmpt configure options: --without-ogg --without-vorbis
--without-vorbisfile --without-portaudio --without-portaudiocpp
--without-mpg123 --without-pulseaudio --without-sndfile --without-flac

Signed-off-by: Jörn Heusipp 
Signed-off-by: Josh de Kock 

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

 libavformat/libopenmpt.c | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index a7e385959a..af6eb1ac4a 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -93,14 +93,7 @@ static int read_header_openmpt(AVFormatContext *s)
 if (!openmpt->module)
 return AVERROR_INVALIDDATA;
 
-openmpt->channels   = av_get_channel_layout_nb_channels(openmpt->layout);
-openmpt->duration   = openmpt_module_get_duration_seconds(openmpt->module);
-
-add_meta(s, "artist",  openmpt_module_get_metadata(openmpt->module, 
"artist"));
-add_meta(s, "title",   openmpt_module_get_metadata(openmpt->module, 
"title"));
-add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, 
"tracker"));
-add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, 
"message"));
-add_meta(s, "date",openmpt_module_get_metadata(openmpt->module, 
"date"));
+openmpt->channels = av_get_channel_layout_nb_channels(openmpt->layout);
 
 if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) {
 openmpt_module_destroy(openmpt->module);
@@ -120,6 +113,14 @@ static int read_header_openmpt(AVFormatContext *s)
 }
 }
 
+openmpt->duration = openmpt_module_get_duration_seconds(openmpt->module);
+
+add_meta(s, "artist",  openmpt_module_get_metadata(openmpt->module, 
"artist"));
+add_meta(s, "title",   openmpt_module_get_metadata(openmpt->module, 
"title"));
+add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, 
"tracker"));
+add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, 
"message"));
+add_meta(s, "date",openmpt_module_get_metadata(openmpt->module, 
"date"));
+
 st = avformat_new_stream(s, NULL);
 if (!st) {
 openmpt_module_destroy(openmpt->module);

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


[FFmpeg-cvslog] avcodec/takdec: Fix integer overflow in decode_lpc()

2017-09-24 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Sep 22 20:45:27 2017 +0200| [5d31f03a0264cac24434c8108daef4ccba6d28f9] | 
committer: Michael Niedermayer

avcodec/takdec: Fix integer overflow in decode_lpc()

Fixes: runtime error: signed integer overflow: 16748560 + 2143729712 cannot be 
represented in type 'int'
Fixes: 3202/clusterfuzz-testcase-minimized-4988291642294272

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

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

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

diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index 9c253c1e8e..0439a3ac9b 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -206,7 +206,7 @@ static void decode_lpc(int32_t *coeffs, int mode, int 
length)
 unsigned a1 = *coeffs++;
 for (i = 0; i < length - 1 >> 1; i++) {
 *coeffs   += a1;
-coeffs[1] += *coeffs;
+coeffs[1] += (unsigned)*coeffs;
 a1 = coeffs[1];
 coeffs+= 2;
 }

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


[FFmpeg-cvslog] avcodec/proresdec2: Check bits in DECODE_CODEWORD(), fixes invalid shift

2017-09-24 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Sep 22 20:45:28 2017 +0200| [4f5eaf0b5956e492ee5023929669b1d09aaf6299] | 
committer: Michael Niedermayer

avcodec/proresdec2: Check bits in DECODE_CODEWORD(), fixes invalid shift

Fixes: runtime error: shift exponent 42 is too large for 32-bit type 'unsigned 
int'
Fixes: 3410/clusterfuzz-testcase-minimized-5313377960198144

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

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

 libavcodec/proresdec2.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index 73b161f9a5..e077908027 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -267,6 +267,8 @@ static int decode_picture_header(AVCodecContext *avctx, 
const uint8_t *buf, cons
 \
 if (q > switch_bits) { /* exp golomb */ \
 bits = exp_order - switch_bits + (q<<1);\
+if (bits > MIN_CACHE_BITS)  \
+return AVERROR_INVALIDDATA; \
 val = SHOW_UBITS(re, gb, bits) - (1 << exp_order) + \
 ((switch_bits + 1) << rice_order);  \
 SKIP_BITS(re, gb, bits);\
@@ -286,7 +288,7 @@ static int decode_picture_header(AVCodecContext *avctx, 
const uint8_t *buf, cons
 
 static const uint8_t dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 
0x70};
 
-static av_always_inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out,
+static av_always_inline int decode_dc_coeffs(GetBitContext *gb, int16_t *out,
   int blocks_per_slice)
 {
 int16_t prev_dc;
@@ -310,6 +312,7 @@ static av_always_inline void decode_dc_coeffs(GetBitContext 
*gb, int16_t *out,
 out[0] = prev_dc;
 }
 CLOSE_READER(re, gb);
+return 0;
 }
 
 // adaptive codebook switching lut according to previous run/level values
@@ -376,7 +379,8 @@ static int decode_slice_luma(AVCodecContext *avctx, 
SliceContext *slice,
 
 init_get_bits(&gb, buf, buf_size << 3);
 
-decode_dc_coeffs(&gb, blocks, blocks_per_slice);
+if ((ret = decode_dc_coeffs(&gb, blocks, blocks_per_slice)) < 0)
+return ret;
 if ((ret = decode_ac_coeffs(avctx, &gb, blocks, blocks_per_slice)) < 0)
 return ret;
 
@@ -409,7 +413,8 @@ static int decode_slice_chroma(AVCodecContext *avctx, 
SliceContext *slice,
 
 init_get_bits(&gb, buf, buf_size << 3);
 
-decode_dc_coeffs(&gb, blocks, blocks_per_slice);
+if ((ret = decode_dc_coeffs(&gb, blocks, blocks_per_slice)) < 0)
+return ret;
 if ((ret = decode_ac_coeffs(avctx, &gb, blocks, blocks_per_slice)) < 0)
 return ret;
 

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


[FFmpeg-cvslog] avcodec/takdec: Fix integer overflows in decode_subframe()

2017-09-24 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Sep 22 20:45:26 2017 +0200| [3dabb9c69db114b1f30c30e0a2788cffc50bac40] | 
committer: Michael Niedermayer

avcodec/takdec: Fix integer overflows in decode_subframe()

Fixes: runtime error: signed integer overflow: -1562477869 + -691460395 cannot 
be represented in type 'int'
Fixes: 3196/clusterfuzz-testcase-minimized-4528307146063872

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

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

 libavcodec/takdec.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index 1676313b7c..9c253c1e8e 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -486,10 +486,10 @@ static int decode_subframe(TAKDecContext *s, int32_t 
*decoded,
 v += (unsigned)s->adsp.scalarproduct_int16(&s->residues[i], 
s->filter,
  filter_order & -16);
 for (j = filter_order & -16; j < filter_order; j += 4) {
-v += s->residues[i + j + 3] * s->filter[j + 3] +
- s->residues[i + j + 2] * s->filter[j + 2] +
- s->residues[i + j + 1] * s->filter[j + 1] +
- s->residues[i + j] * s->filter[j];
+v += s->residues[i + j + 3] * (unsigned)s->filter[j + 3] +
+ s->residues[i + j + 2] * (unsigned)s->filter[j + 2] +
+ s->residues[i + j + 1] * (unsigned)s->filter[j + 1] +
+ s->residues[i + j] * (unsigned)s->filter[j];
 }
 v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - 
(unsigned)*decoded;
 *decoded++ = v;

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


[FFmpeg-cvslog] fate/fits: add missing png & gif dependencies

2017-09-24 Thread Paras Chadha
ffmpeg | branch: master | Paras Chadha  | Sat Sep 16 
03:42:07 2017 +0530| [4efb1658f5ab4e785b8420a1bc42694494a3d775] | committer: 
Michael Niedermayer

fate/fits: add missing png & gif dependencies

Signed-off-by: Paras Chadha 
Signed-off-by: Michael Niedermayer 

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

 tests/fate/demux.mak | 2 +-
 tests/fate/fits.mak  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index 261b004d69..68d4b6a54c 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -36,7 +36,7 @@ fate-d-cinema-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/d-cinema/THX_Science_FL
 FATE_SAMPLES_DEMUX-$(CONFIG_EA_DEMUXER) += fate-d-eavp6-demux
 fate-d-eavp6-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ea-vp6/SmallRing.vp6 
-map 0 -vcodec copy
 
-FATE_SAMPLES_DEMUX-$(CONFIG_FITS_DEMUXER) += fate-fits-demux
+FATE_SAMPLES_DEMUX-$(call ALLYES, GIF_DEMUXER FITS_DEMUXER GIF_DECODER 
FITS_ENCODER FITS_MUXER) += fate-fits-demux
 fate-fits-demux: tests/data/fits-multi.fits
 fate-fits-demux: CMD = framecrc -i $(TARGET_PATH)/tests/data/fits-multi.fits 
-vcodec copy
 
diff --git a/tests/fate/fits.mak b/tests/fate/fits.mak
index bc1b771a52..3d58f98807 100644
--- a/tests/fate/fits.mak
+++ b/tests/fate/fits.mak
@@ -29,7 +29,7 @@ fate-fitsdec-bitpix-32: CMD = framecrc -i 
$(TARGET_SAMPLES)/fits/tst0005.fits -p
 FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-bitpix-64
 fate-fitsdec-bitpix-64: CMD = framecrc -i $(TARGET_SAMPLES)/fits/tst0006.fits 
-pix_fmt gray16
 
-FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-multi
+FATE_FITS_DEC-$(call ALLYES, GIF_DEMUXER FITS_DEMUXER GIF_DECODER FITS_DECODER 
FITS_ENCODER FITS_MUXER) += fate-fitsdec-multi
 fate-fitsdec-multi: tests/data/fits-multi.fits
 fate-fitsdec-multi: CMD = framecrc -i 
$(TARGET_PATH)/tests/data/fits-multi.fits -pix_fmt gbrap
 
@@ -39,7 +39,7 @@ fate-fitsdec%: CMD = framecrc -i $(SRC) -pix_fmt $(PIXFMT)
 
 FATE_FITS_DEC_PIXFMT = gray gbrp gbrp16 gbrap16
 $(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%): fate-fitsdec-%: 
tests/data/lena-%.fits
-FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += 
$(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%)
+FATE_FITS_DEC-$(call ALLYES, FITS_DEMUXER IMAGE2_DEMUXER FITS_DECODER 
PNG_DECODER FITS_ENCODER FITS_MUXER) += $(FATE_FITS_DEC_PIXFMT:%=fate-fitsdec-%)
 
 FATE_FITS += $(FATE_FITS_DEC-yes)
 fate-fitsdec: $(FATE_FITS_DEC-yes)
@@ -50,7 +50,7 @@ fate-fitsenc%: CMD = framecrc -i $(SRC) -c:v fits -pix_fmt 
$(PIXFMT)
 
 FATE_FITS_ENC_PIXFMT = gray gray16be gbrp gbrap gbrp16be gbrap16be
 $(FATE_FITS_ENC_PIXFMT:%=fate-fitsenc-%): tests/data/fits-multi.fits
-FATE_FITS_ENC-$(call ENCDEC, FITS, FITS) += 
$(FATE_FITS_ENC_PIXFMT:%=fate-fitsenc-%)
+FATE_FITS_ENC-$(call ALLYES, GIF_DEMUXER GIF_DECODER FITS_ENCODER FITS_MUXER) 
+= $(FATE_FITS_ENC_PIXFMT:%=fate-fitsenc-%)
 
 FATE_FITS += $(FATE_FITS_ENC-yes)
 fate-fitsenc: $(FATE_FITS_ENC-yes)

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


[FFmpeg-cvslog] libavcodec/hapdec : add support HapAlphaOnly

2017-09-24 Thread Martin Vignali
ffmpeg | branch: master | Martin Vignali  | Sat Sep 
23 21:50:54 2017 +0200| [cab71e4e4e51c8cee4fdd90af35498796797615c] | committer: 
Michael Niedermayer

libavcodec/hapdec : add support HapAlphaOnly

Signed-off-by: Michael Niedermayer 

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

 libavcodec/hap.h|  1 +
 libavcodec/hapdec.c | 14 --
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hap.h b/libavcodec/hap.h
index f39e621805..0ee65335d9 100644
--- a/libavcodec/hap.h
+++ b/libavcodec/hap.h
@@ -34,6 +34,7 @@ enum HapTextureFormat {
 HAP_FMT_RGBDXT1   = 0x0B,
 HAP_FMT_RGBADXT5  = 0x0E,
 HAP_FMT_YCOCGDXT5 = 0x0F,
+HAP_FMT_RGTC1 = 0x01,
 };
 
 enum HapCompressor {
diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c
index a1cb0c76aa..fc9dff10f1 100644
--- a/libavcodec/hapdec.c
+++ b/libavcodec/hapdec.c
@@ -24,7 +24,7 @@
  * @file
  * Hap decoder
  *
- * Fourcc: Hap1, Hap5, HapY
+ * Fourcc: Hap1, Hap5, HapY, HapA, HapM
  *
  * https://github.com/Vidvox/hap/blob/master/documentation/HapVideoDRAFT.md
  */
@@ -163,7 +163,8 @@ static int hap_parse_frame_header(AVCodecContext *avctx)
 
 if ((avctx->codec_tag == MKTAG('H','a','p','1') && (section_type & 0x0F) 
!= HAP_FMT_RGBDXT1) ||
 (avctx->codec_tag == MKTAG('H','a','p','5') && (section_type & 0x0F) 
!= HAP_FMT_RGBADXT5) ||
-(avctx->codec_tag == MKTAG('H','a','p','Y') && (section_type & 0x0F) 
!= HAP_FMT_YCOCGDXT5)) {
+(avctx->codec_tag == MKTAG('H','a','p','Y') && (section_type & 0x0F) 
!= HAP_FMT_YCOCGDXT5) ||
+(avctx->codec_tag == MKTAG('H','a','p','A') && (section_type & 0x0F) 
!= HAP_FMT_RGTC1)) {
 av_log(avctx, AV_LOG_ERROR,
"Invalid texture format %#04x.\n", section_type & 0x0F);
 return AVERROR_INVALIDDATA;
@@ -403,6 +404,15 @@ static av_cold int hap_init(AVCodecContext *avctx)
 ctx->tex_fun = ctx->dxtc.dxt5ys_block;
 avctx->pix_fmt = AV_PIX_FMT_RGB0;
 break;
+case MKTAG('H','a','p','A'):
+texture_name = "RGTC1";
+ctx->tex_rat = 8;
+ctx->tex_fun = ctx->dxtc.rgtc1u_block;
+avctx->pix_fmt = AV_PIX_FMT_RGB0;
+break;
+case MKTAG('H','a','p','M'):
+avpriv_report_missing_feature(avctx, "HapQAlpha");
+return AVERROR_PATCHWELCOME;
 default:
 return AVERROR_DECODER_NOT_FOUND;
 }

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


[FFmpeg-cvslog] libavformat : add mov dataformat tag for HapAlphaOnly and HapQAlpha

2017-09-24 Thread Martin Vignali
ffmpeg | branch: master | Martin Vignali  | Sat Sep 
23 21:43:44 2017 +0200| [45c15b7490cfb1106ce3153e77f04988b74a9ca1] | committer: 
Michael Niedermayer

libavformat : add mov dataformat tag for HapAlphaOnly and HapQAlpha

Signed-off-by: Michael Niedermayer 

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

 libavformat/isom.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 0ae8450469..77983c5eaa 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -274,6 +274,8 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
 { AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', '1') },
 { AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', '5') },
 { AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', 'Y') },
+{ AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', 'A') },
+{ AV_CODEC_ID_HAP, MKTAG('H', 'a', 'p', 'M') },
 
 { AV_CODEC_ID_DXV, MKTAG('D', 'X', 'D', '3') },
 { AV_CODEC_ID_DXV, MKTAG('D', 'X', 'D', 'I') },

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