From e33db35b4a91ad543d9dde3a981a89118ba68937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 17 Jan 2013 16:03:36 +0200 Subject: [PATCH 1/4] theora: Skip zero-sized headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a regression since d9cf5f51 with theora over RTP (possibly with other variants of theora as well). In theora over RTP, the second of the 3 headers turns out to be 0 bytes long, which prior to d9cf5f51 worked just fine. After d9cf5f51, reading from the bitstream reader fails (since the reader wasn't initialized but returned an error if initialized with 0 bits). CC: libav-stable@libav.org Signed-off-by: Martin Storsjö --- libavcodec/vp3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index bdd4289a49..0340c22bb2 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2339,6 +2339,8 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) } for(i=0;i<3;i++) { + if (header_len[i] <= 0) + continue; init_get_bits(&gb, header_start[i], header_len[i] * 8); ptype = get_bits(&gb, 8); From 973b4d44f1e87df63d78b864eeb5988119f822e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 17 Jan 2013 18:58:25 +0200 Subject: [PATCH 2/4] float_dsp: Add #ifdef HAVE_INLINE_ASM around vector_fmul_window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes builds on 64bit MSVC. Signed-off-by: Martin Storsjö --- libavutil/x86/float_dsp_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c index 56fb32b0d5..1c678cb40c 100644 --- a/libavutil/x86/float_dsp_init.c +++ b/libavutil/x86/float_dsp_init.c @@ -41,7 +41,7 @@ extern void ff_vector_dmul_scalar_sse2(double *dst, const double *src, extern void ff_vector_dmul_scalar_avx(double *dst, const double *src, double mul, int len); -#if HAVE_6REGS +#if HAVE_6REGS && HAVE_INLINE_ASM static void vector_fmul_window_3dnowext(float *dst, const float *src0, const float *src1, const float *win, int len) @@ -105,13 +105,13 @@ static void vector_fmul_window_sse(float *dst, const float *src0, : "r"(dst + len), "r"(src0 + len), "r"(src1), "r"(win + len) ); } -#endif /* HAVE_6REGS */ +#endif /* HAVE_6REGS && HAVE_INLINE_ASM */ void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) { int mm_flags = av_get_cpu_flags(); -#if HAVE_6REGS +#if HAVE_6REGS && HAVE_INLINE_ASM if (INLINE_AMD3DNOWEXT(mm_flags)) { fdsp->vector_fmul_window = vector_fmul_window_3dnowext; } From 43e0e0c4e56d754988f6d2d7eec1c302cee5d5ec Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Thu, 17 Jan 2013 11:24:01 +0100 Subject: [PATCH 3/4] libcdio: support recent cdio-paranoia Upstream decided to split the paranoia interface and move the headers accordingly. --- configure | 7 +++++-- libavdevice/libcdio.c | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 879c36d178..f7350b38fd 100755 --- a/configure +++ b/configure @@ -1199,6 +1199,8 @@ HAVE_LIST=" asm_mod_y attribute_may_alias attribute_packed + cdio_paranoia_h + cdio_paranoia_paranoia_h closesocket cmov CommandLineToArgvW @@ -3558,8 +3560,9 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio -enabled libcdio && - check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio +if enabled libcdio; then + check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio +fi enabled x11grab && require X11 X11/Xlib.h XOpenDisplay -lX11 && diff --git a/libavdevice/libcdio.c b/libavdevice/libcdio.c index e846ee635b..06ddb4a784 100644 --- a/libavdevice/libcdio.c +++ b/libavdevice/libcdio.c @@ -23,8 +23,15 @@ * libcdio CD grabbing */ +#include "config.h" + +#if HAVE_CDIO_PARANOIA_H #include #include +#elif HAVE_CDIO_PARANOIA_PARANOIA_H +#include +#include +#endif #include "libavutil/log.h" #include "libavutil/mem.h" From 80ac87c13dc8c6c063e26a464c5c542357c0583f Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Thu, 17 Jan 2013 14:12:44 +0100 Subject: [PATCH 4/4] lavc: support ZenoXVID custom tag Looks like this kind of samples are produced by certain Russian equipment. --- libavcodec/h263dec.c | 2 +- libavformat/riff.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index fc5f565131..7e64538198 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -441,7 +441,7 @@ retry: if(s->xvid_build==-1 && s->divx_version==-1 && s->lavc_build==-1){ if(s->stream_codec_tag == AV_RL32("XVID") || s->codec_tag == AV_RL32("XVID") || s->codec_tag == AV_RL32("XVIX") || - s->codec_tag == AV_RL32("RMP4") || + s->codec_tag == AV_RL32("RMP4") || s->codec_tag == AV_RL32("ZMP4") || s->codec_tag == AV_RL32("SIPP") ) s->xvid_build= 0; diff --git a/libavformat/riff.c b/libavformat/riff.c index 95c079e561..d24231a50b 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -55,6 +55,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { AV_CODEC_ID_MPEG4, MKTAG('M', 'P', '4', 'S') }, { AV_CODEC_ID_MPEG4, MKTAG('M', '4', 'S', '2') }, { AV_CODEC_ID_MPEG4, MKTAG( 4 , 0 , 0 , 0 ) }, /* some broken avi use this */ + { AV_CODEC_ID_MPEG4, MKTAG('Z', 'M', 'P', '4') }, /* some broken avi use this */ { AV_CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', '1') }, { AV_CODEC_ID_MPEG4, MKTAG('B', 'L', 'Z', '0') }, { AV_CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 'v') },