[FFmpeg-cvslog] configure: Factorize check_64_bit()

2018-02-11 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Fri Oct 20 
04:42:13 2017 +0200| [fd36cf6bf6524247a8ff6788c028836fe7d9fd20] | committer: 
Diego Biurrun

configure: Factorize check_64_bit()

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

 configure | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index b4c6320f7a..ed930e6cd4 100755
--- a/configure
+++ b/configure
@@ -3773,7 +3773,7 @@ check_host_cflags $host_cflags_speed
 check_64bit(){
 arch32=$1
 arch64=$2
-expr=$3
+expr=${3:-'sizeof(void *) > 4'}
 check_code cc "" "int test[2*($expr) - 1]" &&
 subarch=$arch64 || subarch=$arch32
 enable $subarch
@@ -3788,23 +3788,23 @@ case "$arch" in
 enabled shared && enable_weak pic
 ;;
 parisc)
-check_64bit parisc parisc64 'sizeof(void *) > 4'
+check_64bit parisc parisc64
 enabled shared && enable_weak pic
 ;;
 ppc)
-check_64bit ppc ppc64 'sizeof(void *) > 4'
+check_64bit ppc ppc64
 enabled shared && enable_weak pic
 ;;
 s390)
-check_64bit s390 s390x 'sizeof(void *) > 4'
+check_64bit s390 s390x
 enabled shared && enable_weak pic
 ;;
 sparc)
-check_64bit sparc sparc64 'sizeof(void *) > 4'
+check_64bit sparc sparc64
 enabled shared && enable_weak pic
 ;;
 x86)
-check_64bit x86_32 x86_64 'sizeof(void *) > 4'
+check_64bit x86_32 x86_64
 if enabled x86_64; then
 enabled shared && enable_weak pic
 objformat=elf64

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


[FFmpeg-cvslog] Merge commit 'fd36cf6bf6524247a8ff6788c028836fe7d9fd20'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 23:18:25 
2018 -0300| [4961ddfd3563a075bdea7d729361adc95370d967] | committer: James Almer

Merge commit 'fd36cf6bf6524247a8ff6788c028836fe7d9fd20'

* commit 'fd36cf6bf6524247a8ff6788c028836fe7d9fd20':
  configure: Factorize check_64_bit()

Merged-by: James Almer 

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

 configure | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 760aae59f0..99c53d482a 100755
--- a/configure
+++ b/configure
@@ -4864,7 +4864,7 @@ check_host_cflags $host_cflags_speed
 check_64bit(){
 arch32=$1
 arch64=$2
-expr=$3
+expr=${3:-'sizeof(void *) > 4'}
 check_code cc "" "int test[2*($expr) - 1]" &&
 subarch=$arch64 || subarch=$arch32
 enable $subarch
@@ -4879,23 +4879,23 @@ case "$arch" in
 enabled shared && enable_weak pic
 ;;
 parisc)
-check_64bit parisc parisc64 'sizeof(void *) > 4'
+check_64bit parisc parisc64
 enabled shared && enable_weak pic
 ;;
 ppc)
-check_64bit ppc ppc64 'sizeof(void *) > 4'
+check_64bit ppc ppc64
 enabled shared && enable_weak pic
 ;;
 s390)
-check_64bit s390 s390x 'sizeof(void *) > 4'
+check_64bit s390 s390x
 enabled shared && enable_weak pic
 ;;
 sparc)
-check_64bit sparc sparc64 'sizeof(void *) > 4'
+check_64bit sparc sparc64
 enabled shared && enable_weak pic
 ;;
 x86)
-check_64bit x86_32 x86_64 'sizeof(void *) > 4'
+check_64bit x86_32 x86_64
 # Treat x32 as x64 for now. Note it also needs pic if shared
 test "$subarch" = "x86_32" && check_cpp_condition stddef.h 
'defined(__x86_64__)' &&
 subarch=x86_64 && enable x86_64 && disable x86_32


==

diff --cc configure
index 760aae59f0,ed930e6cd4..99c53d482a
--- a/configure
+++ b/configure
@@@ -4895,10 -3804,7 +4895,10 @@@ case "$arch" i
  enabled shared && enable_weak pic
  ;;
  x86)
- check_64bit x86_32 x86_64 'sizeof(void *) > 4'
+ check_64bit x86_32 x86_64
 +# Treat x32 as x64 for now. Note it also needs pic if shared
 +test "$subarch" = "x86_32" && check_cpp_condition stddef.h 
'defined(__x86_64__)' &&
 +subarch=x86_64 && enable x86_64 && disable x86_32
  if enabled x86_64; then
  enabled shared && enable_weak pic
  objformat=elf64

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


[FFmpeg-cvslog] configure: Simplify restrict keyword handling

2018-02-11 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Fri Nov 10 
15:40:30 2017 +0100| [38434a9ff5b9a1a048f32c1c7e2a9519cf12f8ba] | committer: 
Diego Biurrun

configure: Simplify restrict keyword handling

Skip a variable indirection and only redefine restrict if necessary.

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

 configure | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 9f84f88014..b4c6320f7a 100755
--- a/configure
+++ b/configure
@@ -4144,9 +4144,8 @@ extern_prefix=${sym%%ff_extern*}
 
 ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
 
-_restrict=
-for restrict_keyword in restrict __restrict__ __restrict; do
-check_cc < $TMPH <> $TMPH
+
 test -n "$malloc_prefix" &&
 echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
 

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


[FFmpeg-cvslog] Merge commit '38434a9ff5b9a1a048f32c1c7e2a9519cf12f8ba'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 23:11:06 
2018 -0300| [c1c720d5279aa2e8e0518e2900f5f2b267ee974a] | committer: James Almer

Merge commit '38434a9ff5b9a1a048f32c1c7e2a9519cf12f8ba'

* commit '38434a9ff5b9a1a048f32c1c7e2a9519cf12f8ba':
  configure: Simplify restrict keyword handling

Merged-by: James Almer 

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

 configure | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 1f7978049e..760aae59f0 100755
--- a/configure
+++ b/configure
@@ -5307,9 +5307,8 @@ extern_prefix=${sym%%ff_extern*}
 
 ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
 
-_restrict=
-for restrict_keyword in restrict __restrict__ __restrict; do
-check_cc < $TMPH <= 190024218" ||
 +check_cflags -d2SSAOptimizer-
 +# enable utf-8 source processing on VS2015 U2 and newer
 +check_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
 +add_cflags -utf-8
  fi
  
  for pfx in "" host_; do
@@@ -6964,25 -5316,19 +6963,25 @@@ don
  
  cat > $TMPH <> $TMPH
 +test -n "$assert_level" &&
 +echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  
  test -n "$malloc_prefix" &&
  echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH

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


[FFmpeg-cvslog] Merge commit '4cf84e254ae75b524e1cacae499a97d7cc9e5906'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 23:08:48 
2018 -0300| [35347e7e9b2769166ce99cd4c4789dcf2ac463a9] | committer: James Almer

Merge commit '4cf84e254ae75b524e1cacae499a97d7cc9e5906'

* commit '4cf84e254ae75b524e1cacae499a97d7cc9e5906':
  Drop some unnecessary config.h #includes

Merged-by: James Almer 

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

 libavcodec/thread.h  | 1 -
 libavformat/tls.h| 4 ++--
 libavutil/aarch64/cpu.h  | 1 -
 libavutil/arm/cpu.h  | 1 -
 libavutil/cpu_internal.h | 2 ++
 libavutil/ppc/cpu.h  | 1 -
 libavutil/x86/cpu.h  | 1 -
 7 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/thread.h b/libavcodec/thread.h
index 318619316c..540135fbc9 100644
--- a/libavcodec/thread.h
+++ b/libavcodec/thread.h
@@ -29,7 +29,6 @@
 
 #include "libavutil/buffer.h"
 
-#include "config.h"
 #include "avcodec.h"
 
 typedef struct ThreadFrame {
diff --git a/libavformat/tls.h b/libavformat/tls.h
index 9c851bf132..beb19d6d55 100644
--- a/libavformat/tls.h
+++ b/libavformat/tls.h
@@ -22,10 +22,10 @@
 #ifndef AVFORMAT_TLS_H
 #define AVFORMAT_TLS_H
 
-#include "config.h"
-#include "url.h"
 #include "libavutil/opt.h"
 
+#include "url.h"
+
 typedef struct TLSShared {
 char *ca_file;
 int verify;
diff --git a/libavutil/aarch64/cpu.h b/libavutil/aarch64/cpu.h
index cf1b9cc516..2ee3f9323a 100644
--- a/libavutil/aarch64/cpu.h
+++ b/libavutil/aarch64/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_AARCH64_CPU_H
 #define AVUTIL_AARCH64_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/arm/cpu.h b/libavutil/arm/cpu.h
index eb64ed5fcd..1d6cc65dc4 100644
--- a/libavutil/arm/cpu.h
+++ b/libavutil/arm/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_ARM_CPU_H
 #define AVUTIL_ARM_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/cpu_internal.h b/libavutil/cpu_internal.h
index b8bf1e5396..37122d1c5f 100644
--- a/libavutil/cpu_internal.h
+++ b/libavutil/cpu_internal.h
@@ -19,6 +19,8 @@
 #ifndef AVUTIL_CPU_INTERNAL_H
 #define AVUTIL_CPU_INTERNAL_H
 
+#include "config.h"
+
 #include "cpu.h"
 
 #define CPUEXT_SUFFIX(flags, suffix, cpuext)\
diff --git a/libavutil/ppc/cpu.h b/libavutil/ppc/cpu.h
index 0744157c87..36973a54ea 100644
--- a/libavutil/ppc/cpu.h
+++ b/libavutil/ppc/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_PPC_CPU_H
 #define AVUTIL_PPC_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/x86/cpu.h b/libavutil/x86/cpu.h
index 7f4e5d08bb..937c697fa0 100644
--- a/libavutil/x86/cpu.h
+++ b/libavutil/x86/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_X86_CPU_H
 #define AVUTIL_X86_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 


==


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


[FFmpeg-cvslog] Drop some unnecessary config.h #includes

2018-02-11 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Fri Nov  3 
17:20:49 2017 +0100| [4cf84e254ae75b524e1cacae499a97d7cc9e5906] | committer: 
Diego Biurrun

Drop some unnecessary config.h #includes

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

 libavcodec/thread.h  | 1 -
 libavformat/tls.h| 4 ++--
 libavutil/aarch64/cpu.h  | 1 -
 libavutil/arm/cpu.h  | 1 -
 libavutil/cpu_internal.h | 2 ++
 libavutil/ppc/cpu.h  | 1 -
 libavutil/x86/cpu.h  | 1 -
 7 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/thread.h b/libavcodec/thread.h
index 864e67eb98..b06958de80 100644
--- a/libavcodec/thread.h
+++ b/libavcodec/thread.h
@@ -29,7 +29,6 @@
 
 #include "libavutil/buffer.h"
 
-#include "config.h"
 #include "avcodec.h"
 
 typedef struct ThreadFrame {
diff --git a/libavformat/tls.h b/libavformat/tls.h
index 94f30ab854..846aa8333e 100644
--- a/libavformat/tls.h
+++ b/libavformat/tls.h
@@ -22,10 +22,10 @@
 #ifndef AVFORMAT_TLS_H
 #define AVFORMAT_TLS_H
 
-#include "config.h"
-#include "url.h"
 #include "libavutil/opt.h"
 
+#include "url.h"
+
 typedef struct TLSShared {
 char *ca_file;
 int verify;
diff --git a/libavutil/aarch64/cpu.h b/libavutil/aarch64/cpu.h
index f5b1d89132..0f2531b0dc 100644
--- a/libavutil/aarch64/cpu.h
+++ b/libavutil/aarch64/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_AARCH64_CPU_H
 #define AVUTIL_AARCH64_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/arm/cpu.h b/libavutil/arm/cpu.h
index 127993e5dd..99986d908b 100644
--- a/libavutil/arm/cpu.h
+++ b/libavutil/arm/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_ARM_CPU_H
 #define AVUTIL_ARM_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/cpu_internal.h b/libavutil/cpu_internal.h
index 18c744a983..4c5e1308aa 100644
--- a/libavutil/cpu_internal.h
+++ b/libavutil/cpu_internal.h
@@ -19,6 +19,8 @@
 #ifndef AVUTIL_CPU_INTERNAL_H
 #define AVUTIL_CPU_INTERNAL_H
 
+#include "config.h"
+
 #include "cpu.h"
 
 #define CPUEXT_SUFFIX(flags, suffix, cpuext)\
diff --git a/libavutil/ppc/cpu.h b/libavutil/ppc/cpu.h
index a8b823f534..bed687125e 100644
--- a/libavutil/ppc/cpu.h
+++ b/libavutil/ppc/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_PPC_CPU_H
 #define AVUTIL_PPC_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
diff --git a/libavutil/x86/cpu.h b/libavutil/x86/cpu.h
index c0a525dd4e..6373e57db2 100644
--- a/libavutil/x86/cpu.h
+++ b/libavutil/x86/cpu.h
@@ -19,7 +19,6 @@
 #ifndef AVUTIL_X86_CPU_H
 #define AVUTIL_X86_CPU_H
 
-#include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 

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


[FFmpeg-cvslog] configure: Group code that sets the license string with licensing checks

2018-02-11 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Mon Feb  5 
13:53:49 2018 +0100| [bca41545b371efc34e38d1fa8bb12dba8b614da0] | committer: 
Diego Biurrun

configure: Group code that sets the license string with licensing checks

This also moves the setting of the licensing string out of a block that
is skipped when quiet operation is requested.

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

 configure | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 593064f878..9f84f88014 100755
--- a/configure
+++ b/configure
@@ -2881,6 +2881,18 @@ map "die_license_disabled version3" 
$EXTERNAL_LIBRARY_VERSION3_LIST
 
 enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
 
+if enabled nonfree; then
+license="nonfree and unredistributable"
+elif enabled gplv3; then
+license="GPL version 3 or later"
+elif enabled lgplv3; then
+license="LGPL version 3 or later"
+elif enabled gpl; then
+license="GPL version 2 or later"
+else
+license="LGPL version 2.1 or later"
+fi
+
 enabled_all gnutls openssl &&
 die "GnuTLS and OpenSSL must not be enabled at the same time."
 
@@ -5170,17 +5182,6 @@ if test -n "$ignore_tests"; then
 echo
 fi
 
-license="LGPL version 2.1 or later"
-if enabled nonfree; then
-license="nonfree and unredistributable"
-elif enabled gplv3; then
-license="GPL version 3 or later"
-elif enabled lgplv3; then
-license="LGPL version 3 or later"
-elif enabled gpl; then
-license="GPL version 2 or later"
-fi
-
 echo "License: $license"
 
 fi # test "$quiet" != "yes"

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


[FFmpeg-cvslog] Merge commit 'bca41545b371efc34e38d1fa8bb12dba8b614da0'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 22:59:18 
2018 -0300| [8a15ad8a175cb97d6c1102b777f28e4d20846fec] | committer: James Almer

Merge commit 'bca41545b371efc34e38d1fa8bb12dba8b614da0'

* commit 'bca41545b371efc34e38d1fa8bb12dba8b614da0':
  configure: Group code that sets the license string with licensing checks

Merged-by: James Almer 

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

 configure | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index fee7d97cc3..1f7978049e 100755
--- a/configure
+++ b/configure
@@ -3795,6 +3795,18 @@ map "die_license_disabled nonfree" 
$HWACCEL_LIBRARY_NONFREE_LIST
 
 enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
 
+if enabled nonfree; then
+license="nonfree and unredistributable"
+elif enabled gplv3; then
+license="GPL version 3 or later"
+elif enabled lgplv3; then
+license="LGPL version 3 or later"
+elif enabled gpl; then
+license="GPL version 2 or later"
+else
+license="LGPL version 2.1 or later"
+fi
+
 enabled_all gnutls openssl &&
 die "GnuTLS and OpenSSL must not be enabled at the same time."
 
@@ -,17 +6678,6 @@ postproc_deps="$(filter_out 'gpl' $postproc_deps)"
 
 map 'expand_deps $v' $LIBRARY_LIST
 
-license="LGPL version 2.1 or later"
-if enabled nonfree; then
-license="nonfree and unredistributable"
-elif enabled gplv3; then
-license="GPL version 3 or later"
-elif enabled lgplv3; then
-license="LGPL version 3 or later"
-elif enabled gpl; then
-license="GPL version 2 or later"
-fi
-
 if test "$quiet" != "yes"; then
 
 echo "install prefix$prefix"


==

diff --cc configure
index fee7d97cc3,9f84f88014..1f7978049e
--- a/configure
+++ b/configure
@@@ -6661,22 -5090,8 +6673,11 @@@ expand_deps()
  unique $lib_deps
  }
  
 +#we have to remove gpl from the deps here as some code assumes all lib deps 
are libs
 +postproc_deps="$(filter_out 'gpl' $postproc_deps)"
 +
  map 'expand_deps $v' $LIBRARY_LIST
  
- license="LGPL version 2.1 or later"
- if enabled nonfree; then
- license="nonfree and unredistributable"
- elif enabled gplv3; then
- license="GPL version 3 or later"
- elif enabled lgplv3; then
- license="LGPL version 3 or later"
- elif enabled gpl; then
- license="GPL version 2 or later"
- fi
- 
  if test "$quiet" != "yes"; then
  
  echo "install prefix$prefix"

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


[FFmpeg-cvslog] hwcontext: Fix memory leak on derived frame allocation failure

2018-02-11 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Fri Jan 26 23:12:18 
2018 +| [2eb396b175e55e515aa6a13c5b1789a2a18d3935] | committer: Mark 
Thompson

hwcontext: Fix memory leak on derived frame allocation failure

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

 libavutil/hwcontext.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 6dc95bba15..2630087b5d 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -470,8 +470,10 @@ int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, 
AVFrame *frame, int flags)
 
 ret = av_hwframe_get_buffer(ctx->internal->source_frames,
 src_frame, 0);
-if (ret < 0)
+if (ret < 0) {
+av_frame_free(_frame);
 return ret;
+}
 
 ret = av_hwframe_map(frame, src_frame,
  ctx->internal->source_allocation_map_flags);

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


[FFmpeg-cvslog] Merge commit '96e476cc9d414e248692c773d9dce736662572b8'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 22:49:35 
2018 -0300| [cb2205863b9505441956a459fffe7fed212ea54a] | committer: James Almer

Merge commit '96e476cc9d414e248692c773d9dce736662572b8'

* commit '96e476cc9d414e248692c773d9dce736662572b8':
  hwcontext: Fix documentation for av_hwdevice_ctx_alloc()

This commit is a noop, see 9365dfcbf665b83b2e60c5ec5e2abf1f0a49e2c3

Merged-by: James Almer 

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



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


[FFmpeg-cvslog] Merge commit '2eb396b175e55e515aa6a13c5b1789a2a18d3935'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 22:50:57 
2018 -0300| [0a320f7e7a9bf8e6e9e9c33adfdb5bea743bfd52] | committer: James Almer

Merge commit '2eb396b175e55e515aa6a13c5b1789a2a18d3935'

* commit '2eb396b175e55e515aa6a13c5b1789a2a18d3935':
  hwcontext: Fix memory leak on derived frame allocation failure

Merged-by: James Almer 

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

 libavutil/hwcontext.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 31ac12807b..70c556ecac 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -483,8 +483,10 @@ int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, 
AVFrame *frame, int flags)
 
 ret = av_hwframe_get_buffer(ctx->internal->source_frames,
 src_frame, 0);
-if (ret < 0)
+if (ret < 0) {
+av_frame_free(_frame);
 return ret;
+}
 
 ret = av_hwframe_map(frame, src_frame,
  ctx->internal->source_allocation_map_flags);


==


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


[FFmpeg-cvslog] hwcontext: Fix documentation for av_hwdevice_ctx_alloc()

2018-02-11 Thread Jun Zhao
ffmpeg | branch: master | Jun Zhao  | Sun Mar 19 15:44:46 
2017 +0800| [96e476cc9d414e248692c773d9dce736662572b8] | committer: Mark 
Thompson

hwcontext: Fix documentation for av_hwdevice_ctx_alloc()

From ffmpeg commit 9365dfcbf665b83b2e60c5ec5e2abf1f0a49e2c3.

Signed-off-by: Jun Zhao 
Signed-off-by: Mark Thompson 

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

 libavutil/hwcontext.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index 203ea510ec..ba293d72e5 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -252,8 +252,9 @@ const char *av_hwdevice_get_type_name(enum AVHWDeviceType 
type);
 enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev);
 
 /**
- * Allocate an AVHWDeviceContext for a given pixel format.
+ * Allocate an AVHWDeviceContext for a given hardware type.
  *
+ * @param type the type of the hardware device to allocate.
  * @return a reference to the newly created AVHWDeviceContext on success or 
NULL
  * on failure.
  */

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


[FFmpeg-cvslog] Merge commit '8965e2af921ec5926b26d5ae466ee4104bb5262b'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 22:47:47 
2018 -0300| [6c59f05c74d87b169bd9775e6a399ed298742137] | committer: James Almer

Merge commit '8965e2af921ec5926b26d5ae466ee4104bb5262b'

* commit '8965e2af921ec5926b26d5ae466ee4104bb5262b':
  avpacket: Initialize the allocated padding area in side data

This commit is a noop, see 9cbb3fce5965f4e1423cace3d1dc340a7a8091f4

Merged-by: James Almer 

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



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


[FFmpeg-cvslog] vc1: skip motion compensation when data for last picture is invalid

2018-02-11 Thread Sean McGovern
ffmpeg | branch: master | Sean McGovern  | Sat Jan 27 
21:19:30 2018 -0500| [5085f25ace1e74846a0de3369bedd0e22d1a1bdc] | committer: 
Sean McGovern

vc1: skip motion compensation when data for last picture is invalid

Bug-Id: 1101
Cc: libav-sta...@libav.org

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

 libavcodec/vc1_mc.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vc1_mc.c b/libavcodec/vc1_mc.c
index f4632d6247..18ac47a037 100644
--- a/libavcodec/vc1_mc.c
+++ b/libavcodec/vc1_mc.c
@@ -689,6 +689,11 @@ void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int 
dir2, int avg)
 if (s->avctx->flags & AV_CODEC_FLAG_GRAY)
 return;
 
+if (!s->last_picture.f->data[1]) {
+  av_log(s->avctx, AV_LOG_ERROR, "Bad data in last picture frame.\n");
+  return;
+}
+
 for (i = 0; i < 4; i++) {
 int d = i < 2 ? dir: dir2;
 tx = s->mv[d][i][0];

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


[FFmpeg-cvslog] Merge commit '5085f25ace1e74846a0de3369bedd0e22d1a1bdc'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 22:47:05 
2018 -0300| [d0f098a5e0bae84d98eb48ea5ba173422e004fe3] | committer: James Almer

Merge commit '5085f25ace1e74846a0de3369bedd0e22d1a1bdc'

* commit '5085f25ace1e74846a0de3369bedd0e22d1a1bdc':
  vc1: skip motion compensation when data for last picture is invalid

This commit is a noop. The crash can't be reproduced with ffmpeg.

Merged-by: James Almer 

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



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


[FFmpeg-cvslog] avpacket: Initialize the allocated padding area in side data

2018-02-11 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Thu Feb  1 
14:56:49 2018 +0200| [8965e2af921ec5926b26d5ae466ee4104bb5262b] | committer: 
Martin Storsjö

avpacket: Initialize the allocated padding area in side data

This makes sure that consumers of the side data actually can
rely on the padding as intended, without having the callers of
av_packet_new_side_data to explicitly zero initialize it.

Signed-off-by: Martin Storsjö 

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

 libavcodec/avpacket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 93e9eb6ae7..c705df3d59 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -271,6 +271,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum 
AVPacketSideDataType type,
 data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
 if (!data)
 return NULL;
+memset(data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
 ret = av_packet_add_side_data(pkt, type, data, size);
 if (ret < 0) {

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


[FFmpeg-cvslog] Merge commit '6829a079444e10818a847e153121fb458cc5c0a8'

2018-02-11 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Feb 11 22:44:12 
2018 -0300| [87faeb1e685eedc49d9cb6de14bab1cfc88ab655] | committer: James Almer

Merge commit '6829a079444e10818a847e153121fb458cc5c0a8'

* commit '6829a079444e10818a847e153121fb458cc5c0a8':
  qsvdec: Relax the surface vs coded dimension check

Merged-by: James Almer 

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

 libavcodec/qsv.c| 2 +-
 libavcodec/qsvdec.c | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 250b4e61e3..5217adfa9d 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -389,7 +389,7 @@ static mfxStatus qsv_frame_alloc(mfxHDL pthis, 
mfxFrameAllocRequest *req,
 mfxFrameInfo  *i  = >Info;
 mfxFrameInfo  *i1 = _hwctx->surfaces[0].Info;
 
-if (i->Width  != i1->Width  || i->Height != i1->Height ||
+if (i->Width  > i1->Width  || i->Height > i1->Height ||
 i->FourCC != i1->FourCC || i->ChromaFormat != i1->ChromaFormat) {
 av_log(ctx->logctx, AV_LOG_ERROR, "Mismatching surface properties 
in an "
"allocation request: %dx%d %d %d vs %dx%d %d %d\n",
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index abbede5d97..45bedf9a7b 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -149,9 +149,6 @@ static int qsv_decode_init(AVCodecContext *avctx, 
QSVContext *q)
 else if (frames_hwctx->frame_type & 
MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
 iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
 }
-
-frame_width  = frames_hwctx->surfaces[0].Info.Width;
-frame_height = frames_hwctx->surfaces[0].Info.Height;
 }
 
 if (!iopattern)


==


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


[FFmpeg-cvslog] qsvdec: Relax the surface vs coded dimension check

2018-02-11 Thread Zhong Li
ffmpeg | branch: master | Zhong Li  | Thu Jan 25 18:19:12 
2018 +0800| [6829a079444e10818a847e153121fb458cc5c0a8] | committer: Luca Barbato

qsvdec: Relax the surface vs coded dimension check

Fix a common vp8 decoding failure.

Many vp8 clips cannot decode if hw_frames_ctx is enabled, reporting
"Error during QSV decoding.: incompatible video parameters (-14)".

It is due to mfx.FrameInfo.Width/Height not matching coded_w/coded_h.

See: avconv -hwaccel qsv -init_hw_device qsv -c:v vp8_qsv -i 
vp8-test-vectors-r1/vp80-00-comprehensive-001.ivf
-vf "hwdownload,format=nv12" -pix_fmt yuv420p -f md5 -

Signed-off-by: Zhong Li 
Signed-off-by: Luca Barbato 

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

 libavcodec/qsv.c| 2 +-
 libavcodec/qsvdec.c | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 96dca14e9a..e78633d62a 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -389,7 +389,7 @@ static mfxStatus qsv_frame_alloc(mfxHDL pthis, 
mfxFrameAllocRequest *req,
 mfxFrameInfo  *i  = >Info;
 mfxFrameInfo  *i1 = _hwctx->surfaces[0].Info;
 
-if (i->Width  != i1->Width  || i->Height != i1->Height ||
+if (i->Width  > i1->Width  || i->Height > i1->Height ||
 i->FourCC != i1->FourCC || i->ChromaFormat != i1->ChromaFormat) {
 av_log(ctx->logctx, AV_LOG_ERROR, "Mismatching surface properties 
in an "
"allocation request: %dx%d %d %d vs %dx%d %d %d\n",
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 9741f33109..f31172de29 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -149,9 +149,6 @@ static int qsv_decode_init(AVCodecContext *avctx, 
QSVContext *q)
 else if (frames_hwctx->frame_type & 
MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
 iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
 }
-
-frame_width  = frames_hwctx->surfaces[0].Info.Width;
-frame_height = frames_hwctx->surfaces[0].Info.Height;
 }
 
 if (!iopattern)

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


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. e047806 web/download: add FFmpeg 3.4.2

2018-02-11 Thread ffmpeg-git
The branch, master has been updated
   via  e047806ab009920077923e671698d614d7693335 (commit)
  from  9275cd54eddb83faf5bd40ffaccb5717de8b798d (commit)


- Log -
commit e047806ab009920077923e671698d614d7693335
Author: Michael Niedermayer 
AuthorDate: Mon Feb 12 02:22:12 2018 +0100
Commit: Michael Niedermayer 
CommitDate: Mon Feb 12 02:22:12 2018 +0100

web/download: add FFmpeg 3.4.2

diff --git a/src/download b/src/download
index 91e0623..3f20921 100644
--- a/src/download
+++ b/src/download
@@ -1,10 +1,10 @@
 
 
   
-http://ffmpeg.org/releases/ffmpeg-3.4.1.tar.bz2; class="btn 
btn-success">
+http://ffmpeg.org/releases/ffmpeg-3.4.2.tar.bz2; class="btn 
btn-success">
   
   Download
-  ffmpeg-3.4.1.tar.bz2
+  ffmpeg-3.4.2.tar.bz2
 
 
 More releases
@@ -272,10 +272,10 @@
 and much faster bug fixes such as additional features and security patches.
   
 
-  FFmpeg 3.4.1 "Cantor"
+  FFmpeg 3.4.2 "Cantor"
 
   
-3.4.1 was released on 2017-12-10. It is the latest stable FFmpeg release
+3.4.2 was released on 2018-02-12. It is the latest stable FFmpeg release
 from the 3.4 release branch, which was cut from master on 2017-10-11.
   
   It includes the following library versions:
@@ -293,19 +293,19 @@ libpostproc54.  7.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.4.1;>Changelog
+  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n3.4.2;>Changelog
   https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/refs/heads/release/3.4:/RELEASE_NOTES;>Release
 Notes
  


---

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


hooks/post-receive
-- 

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


[FFmpeg-cvslog] Tag n3.4.2 : FFmpeg 3.4.2 release

2018-02-11 Thread git
[ffmpeg] [branch: refs/tags/n3.4.2]
Tag:72cc23520e308c66cffe869b138c0e3ce90664fc
> http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=72cc23520e308c66cffe869b138c0e3ce90664fc

Tagger: Michael Niedermayer 
Date:   Mon Feb 12 01:50:39 2018 +0100

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


[FFmpeg-cvslog] fate/libavcodec: add codec_desc test

2018-02-11 Thread Muhammad Faiz
ffmpeg | branch: master | Muhammad Faiz  | Sat Feb 10 
16:30:14 2018 +0700| [b7d476b1384fe0e4a2c4d424d880d9c4f0b6f7ca] | committer: 
Muhammad Faiz

fate/libavcodec: add codec_desc test

Remove runtime check at codec_desc.c

Reviewed-by: wm4 
Reviewed-by: Michael Niedermayer 
Signed-off-by: Muhammad Faiz 

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

 libavcodec/Makefile   |  1 +
 libavcodec/codec_desc.c   | 24 ---
 libavcodec/tests/codec_desc.c | 45 +++
 tests/fate/libavcodec.mak |  5 +
 4 files changed, 51 insertions(+), 24 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index beaca9ee51..3d4b738e0b 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1090,6 +1090,7 @@ SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h 
v4l2_context.h v4l2_m2m
 
 TESTPROGS = avpacket\
 celp_math   \
+codec_desc  \
 htmlsubtitles   \
 imgconvert  \
 jpeg2000dwt \
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 15f6489278..44a54a31c9 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -21,10 +21,8 @@
 
 #include 
 
-#include "libavutil/avassert.h"
 #include "libavutil/common.h"
 #include "libavutil/internal.h"
-#include "libavutil/thread.h"
 #include "avcodec.h"
 #include "profiles.h"
 #include "version.h"
@@ -3111,26 +3109,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
 },
 };
 
-#if defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
-static void check_validity(void)
-{
-int i;
-
-for (i = 0; i < FF_ARRAY_ELEMS(codec_descriptors) - 1; i++) {
-if (codec_descriptors[i].id >= codec_descriptors[i+1].id) {
-av_log(NULL, AV_LOG_FATAL, "unsorted codec_id '%s' and '%s'.\n",
-   codec_descriptors[i].name, codec_descriptors[i+1].name);
-av_assert0(0);
-}
-}
-}
-
-static AVOnce check_validity_once = AV_ONCE_INIT;
-#define CHECK_VALIDITY() ff_thread_once(_validity_once, check_validity);
-#else
-#define CHECK_VALIDITY() ((void)0)
-#endif
-
 static int descriptor_compare(const void *key, const void *member)
 {
 enum AVCodecID id = *(const enum AVCodecID *) key;
@@ -3141,8 +3119,6 @@ static int descriptor_compare(const void *key, const void 
*member)
 
 const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id)
 {
-CHECK_VALIDITY();
-
 return bsearch(, codec_descriptors, FF_ARRAY_ELEMS(codec_descriptors),
sizeof(codec_descriptors[0]), descriptor_compare);
 }
diff --git a/libavcodec/tests/codec_desc.c b/libavcodec/tests/codec_desc.c
new file mode 100644
index 00..c9b3497343
--- /dev/null
+++ b/libavcodec/tests/codec_desc.c
@@ -0,0 +1,45 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/avcodec.h"
+
+int main(int argc, char **argv)
+{
+const AVCodecDescriptor *old_desc = NULL, *desc;
+
+while (desc = avcodec_descriptor_next(old_desc)) {
+if (old_desc && old_desc->id >= desc->id) {
+av_log(NULL, AV_LOG_FATAL, "Unsorted codec_descriptors '%s' and 
'%s'.\n", old_desc->name, desc->name);
+return 1;
+}
+
+if (avcodec_descriptor_get(desc->id) != desc) {
+av_log(NULL, AV_LOG_FATAL, "avcodec_descriptor_get() failed with 
'%s'.\n", desc->name);
+return 1;
+}
+
+if (avcodec_descriptor_get_by_name(desc->name) != desc) {
+av_log(NULL, AV_LOG_FATAL, "avcodec_descriptor_get_by_name() 
failed with '%s'.\n", desc->name);
+return 1;
+}
+
+old_desc = desc;
+}
+
+return 0;
+}
diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak
index a2d5d9fe33..d3b2dd874e 100644
--- a/tests/fate/libavcodec.mak
+++ 

[FFmpeg-cvslog] Changelog: update

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Sun Feb 11 22:30:54 2018 +0100| [6a97ba521558ce131fe839eed2d51ff745280e1d] | 
committer: Michael Niedermayer

Changelog: update

Signed-off-by: Michael Niedermayer 

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

 Changelog | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/Changelog b/Changelog
index 45572de937..5db7b0a8a7 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,17 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version 3.4.2:
+- avcodec/vp3: Error out on invalid num_coeffs in unpack_vlcs()
+- avcodec/mpeg4videodec: Ignore multiple VOL headers
+- avcodec/vp3: Check eob_run
+- avcodec/pafvideo: Check allocated frame size
+- avcodec/scpr: Fix reading a pixel before the first
+- avcodec/mpeg2dec: Fix field selection for skipped macroblocks
+- avcodec/huffyuvdec: Check input buffer size
+- avcodec/utvideodec: Fix bytes left check in decode_frame()
+- avcodec/wavpack: Fix integer overflow in FFABS
+- avcodec/aacsbr_fixed: Fix overflows in rounding in sbr_hf_assemble()
+- avcodec/exr: Fix memleaks in decode_header()
 - avcodec/mediacodecdec: use ff_hevc_ps_uninit()
 - avcodec/hevc_parser: use ff_hevc_uninit_parameter_sets()
 - avcodec/hevcdec: use ff_hevc_uninit_parameter_sets()

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


[FFmpeg-cvslog] avcodec/mpeg4videodec: Ignore multiple VOL headers

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Fri Feb  9 22:24:58 2018 +0100| [cec38382dbc8c876186c98c80823619ad6a6c41b] | 
committer: Michael Niedermayer

avcodec/mpeg4videodec: Ignore multiple VOL headers

Fixes: Ticket7005

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

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

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

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index d0162d1074..319a3809ea 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2670,8 +2670,8 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, 
GetBitContext *gb)
 
 if (startcode >= 0x120 && startcode <= 0x12F) {
 if (vol) {
-av_log(s->avctx, AV_LOG_ERROR, "Multiple VOL headers");
-return AVERROR_INVALIDDATA;
+av_log(s->avctx, AV_LOG_WARNING, "Ignoring multiple VOL 
headers\n");
+continue;
 }
 vol++;
 if ((ret = decode_vol_header(ctx, gb)) < 0)

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


[FFmpeg-cvslog] avcodec/pafvideo: Check allocated frame size

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Sun Feb  4 02:14:49 2018 +0100| [4423cbf1b4c195ca595379737225c3cf7b22233b] | 
committer: Michael Niedermayer

avcodec/pafvideo: Check allocated frame size

Fixes: OOM
Fixes: 5549/clusterfuzz-testcase-minimized-5390553567985664

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

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

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

diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c
index 6980ae1b35..7c5861dfaf 100644
--- a/libavcodec/pafvideo.c
+++ b/libavcodec/pafvideo.c
@@ -78,6 +78,7 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
 {
 PAFVideoDecContext *c = avctx->priv_data;
 int i;
+int ret;
 
 c->width  = avctx->width;
 c->height = avctx->height;
@@ -90,6 +91,9 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
 }
 
 avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ret = av_image_check_size2(avctx->width, FFALIGN(avctx->height, 256), 
avctx->max_pixels, avctx->pix_fmt, 0, avctx);
+if (ret < 0)
+return ret;
 
 c->pic = av_frame_alloc();
 if (!c->pic)

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


[FFmpeg-cvslog] avcodec/vp3: Check eob_run

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Fri Feb  9 04:17:16 2018 +0100| [0ff1825ea354ae145110bd80401cf76a306d7fde] | 
committer: Michael Niedermayer

avcodec/vp3: Check eob_run

Fixes: out of array access
Fixes: 5919/clusterfuzz-testcase-minimized-5859311382167552
Fixes: special case for theora (untested due to lack of sample)

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

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

 libavcodec/vp3.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index f167acf4ee..fdffc88486 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -978,6 +978,9 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext 
*gb,
 if (eob_run_get_bits[token])
 eob_run += get_bits(gb, eob_run_get_bits[token]);
 
+if (!eob_run)
+eob_run = INT_MAX;
+
 // record only the number of blocks ended in this plane,
 // any spill will be recorded in the next plane.
 if (eob_run > num_coeffs - coeff_i) {

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


[FFmpeg-cvslog] avcodec/huffyuvdec: Check input buffer size

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Wed Jan 31 19:20:10 2018 +0100| [86296fe24d6fcb94cd69f087c87e10203370a6bb] | 
committer: Michael Niedermayer

avcodec/huffyuvdec: Check input buffer size

Fixes: Timeout
Fixes: 5487/clusterfuzz-testcase-4696837035393024

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 08c220d26cff51ca2f6896b65aebfa3accc67290)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/huffyuvdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 979c4b9d5c..66357bfb40 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -919,6 +919,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 AVFrame *const p = data;
 int table_size = 0, ret;
 
+if (buf_size < (width * height + 7)/8)
+return AVERROR_INVALIDDATA;
+
 av_fast_padded_malloc(>bitstream_buffer,
>bitstream_buffer_size,
buf_size);

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


[FFmpeg-cvslog] avcodec/scpr: Fix reading a pixel before the first

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Sat Feb  3 18:49:07 2018 +0100| [c4153d40d5d8a38a9762fbc9626728beba5887e4] | 
committer: Michael Niedermayer

avcodec/scpr: Fix reading a pixel before the first

Fixes: 5540/clusterfuzz-testcase-minimized-6122458273808384

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

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

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

diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index cbe1bc40d9..ad6073dbf0 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -681,6 +681,8 @@ static int decompress_p(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 
 if (bx == 0) {
+if (by < 2)
+return AVERROR_INVALIDDATA;
 z = backstep;
 } else {
 z = 0;
@@ -710,6 +712,8 @@ static int decompress_p(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 
 if (bx == 0) {
+if (by < 2)
+return AVERROR_INVALIDDATA;
 z = backstep;
 } else {
 z = 0;

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


[FFmpeg-cvslog] avcodec/wavpack: Fix integer overflow in FFABS

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Wed Jan 31 02:50:18 2018 +0100| [5e67a2e13a942a2a84718f354f8f092149fe12bd] | 
committer: Michael Niedermayer

avcodec/wavpack: Fix integer overflow in FFABS

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an 
unsigned type to negate this value to itself
Fixes: 5396/clusterfuzz-testcase-minimized-655829281536

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

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

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

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index d5e1e07b74..0e40b29879 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -480,7 +480,7 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, 
GetBitContext *gb,
 }
 
 if (type == AV_SAMPLE_FMT_S16P) {
-if (FFABS(L) + (unsigned)FFABS(R) > (1<<19)) {
+if (FFABS((int64_t)L) + FFABS((int64_t)R) > (1<<19)) {
 av_log(s->avctx, AV_LOG_ERROR, "sample %d %d too large\n", L, 
R);
 return AVERROR_INVALIDDATA;
 }

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


[FFmpeg-cvslog] avcodec/vp3: Error out on invalid num_coeffs in unpack_vlcs()

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Sun Feb 11 03:38:54 2018 +0100| [2ad23b93b513d3a36af53d90dfc9ebfac80b4e3e] | 
committer: Michael Niedermayer

avcodec/vp3: Error out on invalid num_coeffs in unpack_vlcs()

This fixes a hypothetical integer overflow

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

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

 libavcodec/vp3.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index fdffc88486..e9bb7dcb38 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -951,9 +951,11 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext 
*gb,
 Vp3Fragment *all_fragments = s->all_fragments;
 VLC_TYPE(*vlc_table)[2] = table->table;
 
-if (num_coeffs < 0)
+if (num_coeffs < 0) {
 av_log(s->avctx, AV_LOG_ERROR,
"Invalid number of coefficients at level %d\n", coeff_index);
+return AVERROR_INVALIDDATA;
+}
 
 if (eob_run > num_coeffs) {
 coeff_i  =

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


[FFmpeg-cvslog] avcodec/aacsbr_fixed: Fix overflows in rounding in sbr_hf_assemble()

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Wed Jan 31 18:13:07 2018 +0100| [9efd80dc0996eb0b4c9cde22f96ed7a1f3411cd4] | 
committer: Michael Niedermayer

avcodec/aacsbr_fixed: Fix overflows in rounding in sbr_hf_assemble()

Fixes: runtime error: signed integer overflow: 2052929346 + 204817098 cannot be 
represented in type 'int'
Fixes: 5275/clusterfuzz-testcase-minimized-5367635958038528

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

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

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

diff --git a/libavcodec/aacsbr_fixed.c b/libavcodec/aacsbr_fixed.c
index 3d5875a469..eeada0b9f2 100644
--- a/libavcodec/aacsbr_fixed.c
+++ b/libavcodec/aacsbr_fixed.c
@@ -568,7 +568,8 @@ static void sbr_hf_assemble(int Y1[38][64][2],
 int A = (1-((indexsine+(kx & 1))&2));
 int B = (A^(-idx)) + idx;
 int *out = [i][kx][idx];
-int shift, round;
+int shift;
+unsigned round;
 
 SoftFloat *in  = sbr->s_m[e];
 for (m = 0; m+1 < m_max; m+=2) {
@@ -581,12 +582,12 @@ static void sbr_hf_assemble(int Y1[38][64][2],
 }
 if (shift < 32) {
 round = 1 << (shift-1);
-out[2*m  ] += (in[m  ].mant * A + round) >> shift;
+out[2*m  ] += (int)(in[m  ].mant * A + round) >> shift;
 }
 
 if (shift2 < 32) {
 round = 1 << (shift2-1);
-out[2*m+2] += (in[m+1].mant * B + round) >> shift2;
+out[2*m+2] += (int)(in[m+1].mant * B + round) >> 
shift2;
 }
 }
 if(m_max&1)
@@ -597,7 +598,7 @@ static void sbr_hf_assemble(int Y1[38][64][2],
 return;
 } else if (shift < 32) {
 round = 1 << (shift-1);
-out[2*m  ] += (in[m  ].mant * A + round) >> shift;
+out[2*m  ] += (int)(in[m  ].mant * A + round) >> shift;
 }
 }
 }

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


[FFmpeg-cvslog] avcodec/utvideodec: Fix bytes left check in decode_frame()

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Fri Feb  2 21:44:57 2018 +0100| [342f1da13489de6650349fff2206a81442d6c668] | 
committer: Michael Niedermayer

avcodec/utvideodec: Fix bytes left check in decode_frame()

Fixes: out of array read
Fixes: poc-2017.avi

Found-by: GwanYeong Kim 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 118e1b0b3370dd1c0da442901b486689efd1654b)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 40c12772b3..d888cc3cdf 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -561,7 +561,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 for (j = 0; j < c->slices; j++) {
 slice_end   = bytestream2_get_le32u();
 if (slice_end < 0 || slice_end < slice_start ||
-bytestream2_get_bytes_left() < slice_end) {
+bytestream2_get_bytes_left() < slice_end + 1024LL) {
 av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n");
 return AVERROR_INVALIDDATA;
 }

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


[FFmpeg-cvslog] avcodec/mpeg2dec: Fix field selection for skipped macroblocks

2018-02-11 Thread Nekopanda
ffmpeg | branch: release/3.4 | Nekopanda 
 | Sat Feb 10 18:36:32 2018 +0900| 
[cc0d2f110d9424b0240ac31599e70949169106e1] | committer: Michael Niedermayer

avcodec/mpeg2dec: Fix field selection for skipped macroblocks

For B field pictures, the spec says,

> The prediction shall be made from the field of the same parity as the field 
> being predicted.

I did it.

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

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

 libavcodec/mpeg12dec.c |   2 +
 tests/ref/fate/mpeg2-ticket186 | 328 -
 2 files changed, 166 insertions(+), 164 deletions(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 4e68be27f1..4b76428f53 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1984,6 +1984,8 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
 s->mv[0][0][1] = s->last_mv[0][0][1];
 s->mv[1][0][0] = s->last_mv[1][0][0];
 s->mv[1][0][1] = s->last_mv[1][0][1];
+s->field_select[0][0] = (s->picture_structure - 1) & 1;
+s->field_select[1][0] = (s->picture_structure - 1) & 1;
 }
 }
 }
diff --git a/tests/ref/fate/mpeg2-ticket186 b/tests/ref/fate/mpeg2-ticket186
index b716ca5611..31afda15e8 100644
--- a/tests/ref/fate/mpeg2-ticket186
+++ b/tests/ref/fate/mpeg2-ticket186
@@ -3,354 +3,354 @@
 #codec_id 0: rawvideo
 #dimensions 0: 352x288
 #sar 0: 12/11
-0,  0,  0,1,   152064, 0xd23ffc59
+0,  0,  0,1,   152064, 0x8f9d00c1
 0,  1,  1,1,   152064, 0x899fb8b1
-0,  2,  2,1,   152064, 0x5958d070
+0,  2,  2,1,   152064, 0x7225cb39
 0,  3,  3,1,   152064, 0xf2becd8f
-0,  4,  4,1,   152064, 0xb47bbed7
+0,  4,  4,1,   152064, 0xd56bc556
 0,  5,  5,1,   152064, 0x7ca54f36
-0,  6,  6,1,   152064, 0x02389610
+0,  6,  6,1,   152064, 0x06d7805c
 0,  7,  7,1,   152064, 0x469f3f87
-0,  8,  8,1,   152064, 0x935a780e
+0,  8,  8,1,   152064, 0xdb2f57d5
 0,  9,  9,1,   152064, 0x3876c20c
-0, 10, 10,1,   152064, 0x49df265f
+0, 10, 10,1,   152064, 0x5b670e79
 0, 11, 11,1,   152064, 0xdfe420e0
-0, 12, 12,1,   152064, 0x6e34a0c4
+0, 12, 12,1,   152064, 0x17578222
 0, 13, 13,1,   152064, 0x47e1cb26
-0, 14, 14,1,   152064, 0x68e74188
+0, 14, 14,1,   152064, 0x168e35d6
 0, 15, 15,1,   152064, 0xe9d34b4e
-0, 16, 16,1,   152064, 0xa8665e1a
+0, 16, 16,1,   152064, 0x5e395308
 0, 17, 17,1,   152064, 0x88e3b39f
-0, 18, 18,1,   152064, 0x1c1ab2c3
+0, 18, 18,1,   152064, 0x6b099c51
 0, 19, 19,1,   152064, 0xb1a24ddf
-0, 20, 20,1,   152064, 0x030d5afc
+0, 20, 20,1,   152064, 0xcea840fc
 0, 21, 21,1,   152064, 0x98306d64
-0, 22, 22,1,   152064, 0x5ce0548d
+0, 22, 22,1,   152064, 0xb05354d3
 0, 23, 23,1,   152064, 0xacac26f3
-0, 24, 24,1,   152064, 0xf167f698
+0, 24, 24,1,   152064, 0xbccdf14b
 0, 25, 25,1,   152064, 0xd9398539
-0, 26, 26,1,   152064, 0xd7aec2c4
+0, 26, 26,1,   152064, 0x07aec13a
 0, 27, 27,1,   152064, 0xa6ef9440
-0, 28, 28,1,   152064, 0xc289b278
+0, 28, 28,1,   152064, 0x0e7ab64e
 0, 29, 29,1,   152064, 0x3796939d
-0, 30, 30,1,   152064, 0x48c09366
+0, 30, 30,1,   152064, 0xcc219365
 0, 31, 31,1,   152064, 0xf4cc815a
-0, 32, 32,1,   152064, 0x1c63cdc2
+0, 32, 32,1,   152064, 0x8b91c622
 0, 33, 33,1,   152064, 0xd3a8ad8e
-0, 34, 34,1,   152064, 0x70f94bc0
+0, 34, 34,1,   152064, 0x658e498f
 0, 35, 35,1,   152064, 0xf9c115ea
-0, 36, 36,1,   152064, 

[FFmpeg-cvslog] avcodec/exr: Fix memleaks in decode_header()

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Wed Jan 31 17:50:21 2018 +0100| [ce7f65be6ecb29f4270d128f01dc63f8ba4f6f74] | 
committer: Michael Niedermayer

avcodec/exr: Fix memleaks in decode_header()

Fixes: 4793/clusterfuzz-testcase-minimized-5707366629638144

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

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

 libavcodec/exr.c | 82 ++--
 1 file changed, 56 insertions(+), 26 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 454dc74cfb..f08576af22 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1306,6 +1306,7 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 AVDictionary *metadata = NULL;
 int magic_number, version, i, flags, sar = 0;
 int layer_match = 0;
+int ret;
 
 s->current_channel_offset = 0;
 s->xmin   = ~0;
@@ -1364,8 +1365,10 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 if ((var_size = check_header_variable(s, "channels",
   "chlist", 38)) >= 0) {
 GetByteContext ch_gb;
-if (!var_size)
-return AVERROR_INVALIDDATA;
+if (!var_size) {
+ret = AVERROR_INVALIDDATA;
+goto fail;
+}
 
 bytestream2_init(_gb, s->gb.buffer, var_size);
 
@@ -1424,14 +1427,16 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 
 if (bytestream2_get_bytes_left(_gb) < 4) {
 av_log(s->avctx, AV_LOG_ERROR, "Incomplete header.\n");
-return AVERROR_INVALIDDATA;
+ret = AVERROR_INVALIDDATA;
+goto fail;
 }
 
 current_pixel_type = bytestream2_get_le32(_gb);
 if (current_pixel_type >= EXR_UNKNOWN) {
 avpriv_report_missing_feature(s->avctx, "Pixel type %d",
   current_pixel_type);
-return AVERROR_PATCHWELCOME;
+ret = AVERROR_PATCHWELCOME;
+goto fail;
 }
 
 bytestream2_skip(_gb, 4);
@@ -1442,7 +1447,8 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 avpriv_report_missing_feature(s->avctx,
   "Subsampling %dx%d",
   xsub, ysub);
-return AVERROR_PATCHWELCOME;
+ret = AVERROR_PATCHWELCOME;
+goto fail;
 }
 
 if (channel_index >= 0 && s->channel_offsets[channel_index] == 
-1) { /* channel has not been previously assigned */
@@ -1450,7 +1456,8 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 s->pixel_type != current_pixel_type) {
 av_log(s->avctx, AV_LOG_ERROR,
"RGB channels not of the same depth.\n");
-return AVERROR_INVALIDDATA;
+ret = AVERROR_INVALIDDATA;
+goto fail;
 }
 s->pixel_type = current_pixel_type;
 s->channel_offsets[channel_index] = 
s->current_channel_offset;
@@ -1458,8 +1465,10 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 
 s->channels = av_realloc(s->channels,
  ++s->nb_channels * 
sizeof(EXRChannel));
-if (!s->channels)
-return AVERROR(ENOMEM);
+if (!s->channels) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 channel = >channels[s->nb_channels - 1];
 channel->pixel_type = current_pixel_type;
 channel->xsub   = xsub;
@@ -1484,7 +1493,8 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 av_log(s->avctx, AV_LOG_ERROR, "Missing green 
channel.\n");
 if (s->channel_offsets[2] < 0)
 av_log(s->avctx, AV_LOG_ERROR, "Missing blue 
channel.\n");
-return AVERROR_INVALIDDATA;
+ret = AVERROR_INVALIDDATA;
+goto fail;
 }
 }
 
@@ -1493,8 +1503,10 @@ static int decode_header(EXRContext *s, AVFrame *frame)
 continue;
 } else if ((var_size = check_header_variable(s, "dataWindow", "box2i",
  

[FFmpeg-cvslog] lavf/rtpdec: Constify several pointers.

2018-02-11 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Sat Feb 10 
02:54:42 2018 +0100| [dced1f6cdfe479965898bed3cb5219d2ddbb0ad9] | committer: 
Carl Eugen Hoyos

lavf/rtpdec: Constify several pointers.

Fixes two warnings:
libavformat/rtpdec.c:155:20: warning: return discards 'const' qualifier from 
pointer target type [-Wdiscarded-qualifiers]
libavformat/rtpdec.c:168:20: warning: return discards 'const' qualifier from 
pointer target type [-Wdiscarded-qualifiers]

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

 libavformat/rdt.c| 2 +-
 libavformat/rdt.h| 2 +-
 libavformat/rtpdec.c | 6 +++---
 libavformat/rtpdec.h | 6 +++---
 libavformat/rtsp.c   | 8 
 libavformat/rtsp.h   | 2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 31a32ffec3..60c36f09e6 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -53,7 +53,7 @@ struct RDTDemuxContext {
 
 RDTDemuxContext *
 ff_rdt_parse_open(AVFormatContext *ic, int first_stream_of_set_idx,
-  void *priv_data, RTPDynamicProtocolHandler *handler)
+  void *priv_data, const RTPDynamicProtocolHandler *handler)
 {
 RDTDemuxContext *s = av_mallocz(sizeof(RDTDemuxContext));
 if (!s)
diff --git a/libavformat/rdt.h b/libavformat/rdt.h
index 2480565688..67fb308421 100644
--- a/libavformat/rdt.h
+++ b/libavformat/rdt.h
@@ -41,7 +41,7 @@ typedef struct RDTDemuxContext RDTDemuxContext;
 RDTDemuxContext *ff_rdt_parse_open(AVFormatContext *ic,
int first_stream_of_set_idx,
void *priv_data,
-   RTPDynamicProtocolHandler *handler);
+   const RTPDynamicProtocolHandler *handler);
 void ff_rdt_parse_close(RDTDemuxContext *s);
 
 /**
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 6499e275ff..e75a34cb93 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -143,7 +143,7 @@ const RTPDynamicProtocolHandler 
*ff_rtp_handler_iterate(void **opaque)
 return r;
 }
 
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name,
+const RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name,
enum AVMediaType 
codec_type)
 {
 void *i = 0;
@@ -157,7 +157,7 @@ RTPDynamicProtocolHandler 
*ff_rtp_handler_find_by_name(const char *name,
 return NULL;
 }
 
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id,
+const RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id,
  enum AVMediaType 
codec_type)
 {
 void *i = 0;
@@ -572,7 +572,7 @@ RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, 
AVStream *st,
 }
 
 void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
-   RTPDynamicProtocolHandler *handler)
+   const RTPDynamicProtocolHandler 
*handler)
 {
 s->dynamic_protocol_context = ctx;
 s->handler  = handler;
diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h
index fe726a6886..5a47d6f79d 100644
--- a/libavformat/rtpdec.h
+++ b/libavformat/rtpdec.h
@@ -43,7 +43,7 @@ typedef struct RTPDemuxContext RTPDemuxContext;
 RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st,
int payload_type, int queue_size);
 void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
-   RTPDynamicProtocolHandler *handler);
+   const RTPDynamicProtocolHandler 
*handler);
 void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite,
  const char *params);
 int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
@@ -208,7 +208,7 @@ const RTPDynamicProtocolHandler 
*ff_rtp_handler_iterate(void **opaque);
  * @param name name of the requested rtp dynamic protocol handler
  * @return A rtp dynamic protocol handler if one was found, NULL otherwise.
  */
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name,
+const RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name,
   enum AVMediaType codec_type);
 /**
  * Find a registered rtp dynamic protocol handler with a matching codec ID.
@@ -216,7 +216,7 @@ RTPDynamicProtocolHandler 
*ff_rtp_handler_find_by_name(const char *name,
  * @param id AVCodecID of the requested rtp dynamic protocol handler.
  * @return A rtp dynamic protocol handler if one was found, NULL otherwise.
  */
-RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id,
+const RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id,
 enum AVMediaType codec_type);
 
 

[FFmpeg-cvslog] avcodec/vp3: Error out on invalid num_coeffs in unpack_vlcs()

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Feb 11 03:38:54 2018 +0100| [f2318aee8ca8df1c84092f7d6691a2d0df02c474] | 
committer: Michael Niedermayer

avcodec/vp3: Error out on invalid num_coeffs in unpack_vlcs()

This fixes a hypothetical integer overflow

Signed-off-by: Michael Niedermayer 

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

 libavcodec/vp3.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 33be345c14..1d83753314 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -951,9 +951,11 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext 
*gb,
 Vp3Fragment *all_fragments = s->all_fragments;
 VLC_TYPE(*vlc_table)[2] = table->table;
 
-if (num_coeffs < 0)
+if (num_coeffs < 0) {
 av_log(s->avctx, AV_LOG_ERROR,
"Invalid number of coefficients at level %d\n", coeff_index);
+return AVERROR_INVALIDDATA;
+}
 
 if (eob_run > num_coeffs) {
 coeff_i  =

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


[FFmpeg-cvslog] avcodec/utvideodec: Add several out of array read related checks

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Feb  9 15:27:41 2018 +0100| [76cc0f0f673353cd4746cd3b83838ae335e5d9ed] | 
committer: Michael Niedermayer

avcodec/utvideodec: Add several out of array read related checks

Fixes: OV_decode_plane.avi

Found-by: GwanYeong Kim 
Signed-off-by: Michael Niedermayer 

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

 libavcodec/utvideodec.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 1bcd14e74c..c5f5534964 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -268,6 +268,9 @@ static int decode_plane(UtvideoContext *c, int plane_no,
 send   = (height * (slice + 1) / c->slices) & cmask;
 dest   = dst + sstart * stride;
 
+if (3 * ((dst + send * stride - dest + 7)/8) > 
get_bits_left())
+return AVERROR_INVALIDDATA;
+
 for (p = dest; p < dst + send * stride; p += 8) {
 int bits = get_bits_le(, 3);
 
@@ -277,6 +280,9 @@ static int decode_plane(UtvideoContext *c, int plane_no,
 uint32_t sub = 0x80 >> (8 - (bits + 1)), add;
 int k;
 
+if ((bits + 1) * 8 > get_bits_left())
+return AVERROR_INVALIDDATA;
+
 for (k = 0; k < 8; k++) {
 
 p[k] = get_bits_le(, bits + 1);
@@ -639,9 +645,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 for (j = 0; j < c->slices; j++) {
 c->packed_stream[i][j] = packed_stream;
 c->packed_stream_size[i][j] = bytestream2_get_le32();
-left -= c->packed_stream_size[i][j];
-if (left < 0)
+if (c->packed_stream_size[i][j] > left)
 return AVERROR_INVALIDDATA;
+left -= c->packed_stream_size[i][j];
 packed_stream += c->packed_stream_size[i][j];
 }
 }
@@ -652,9 +658,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 for (j = 0; j < c->slices; j++) {
 c->control_stream[i][j] = control_stream;
 c->control_stream_size[i][j] = bytestream2_get_le32();
-left -= c->control_stream_size[i][j];
-if (left < 0)
+if (c->control_stream_size[i][j] > left)
 return AVERROR_INVALIDDATA;
+left -= c->control_stream_size[i][j];
 control_stream += c->control_stream_size[i][j];
 }
 }

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


[FFmpeg-cvslog] avcodec/scpr: Fix reading a pixel before the first

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Feb  3 18:49:07 2018 +0100| [0fb33a82890753233225c61863fff1fcc9d970d4] | 
committer: Michael Niedermayer

avcodec/scpr: Fix reading a pixel before the first

Fixes: 5540/clusterfuzz-testcase-minimized-6122458273808384

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=0fb33a82890753233225c61863fff1fcc9d970d4
---

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

diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index cbe1bc40d9..ad6073dbf0 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -681,6 +681,8 @@ static int decompress_p(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 
 if (bx == 0) {
+if (by < 2)
+return AVERROR_INVALIDDATA;
 z = backstep;
 } else {
 z = 0;
@@ -710,6 +712,8 @@ static int decompress_p(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 
 if (bx == 0) {
+if (by < 2)
+return AVERROR_INVALIDDATA;
 z = backstep;
 } else {
 z = 0;

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


[FFmpeg-cvslog] avcodec/mpeg4videodec: Ignore multiple VOL headers

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Feb  9 22:24:58 2018 +0100| [63a4bdbf3b732504e54cc2b9ec0886e6242a90bc] | 
committer: Michael Niedermayer

avcodec/mpeg4videodec: Ignore multiple VOL headers

Fixes: Ticket7005

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 756753e2fc..19210d97fe 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2707,8 +2707,8 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, 
GetBitContext *gb)
 
 if (startcode >= 0x120 && startcode <= 0x12F) {
 if (vol) {
-av_log(s->avctx, AV_LOG_ERROR, "Multiple VOL headers");
-return AVERROR_INVALIDDATA;
+av_log(s->avctx, AV_LOG_WARNING, "Ignoring multiple VOL 
headers\n");
+continue;
 }
 vol++;
 if ((ret = decode_vol_header(ctx, gb)) < 0)

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


[FFmpeg-cvslog] avcodec/mpeg2dec: Fix motion vector rounding for chroma components

2018-02-11 Thread Nekopanda
ffmpeg | branch: master | Nekopanda  
| Sun Feb 11 17:15:54 2018 +0900| [f4d5d7e8de189ab448a5e662245b57ceb8f20df6] | 
committer: Michael Niedermayer

avcodec/mpeg2dec: Fix motion vector rounding for chroma components

In 16x8 motion compensation, for lower 16x8 region, the input to mpeg_motion() 
for motion_y was "motion_y + 16", which causes wrong rounding. For 4:2:0, 
chroma scaling for y is dividing by two and rounding toward zero. When motion_y 
< 0 and motion_y + 16 > 0, the rounding direction of "motion_y" and "motion_y + 
16" is different and rounding "motion_y + 16" would be incorrect.

We should input "motion_y" as is to round correctly. I add "is_16x8" flag to do 
that.

Signed-off-by: Michael Niedermayer 

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

 libavcodec/mpegvideo_motion.c|  30 -
 tests/ref/fate/filter-mcdeint-fast   |  60 +-
 tests/ref/fate/filter-mcdeint-medium |  60 +-
 tests/ref/fate/filter-w3fdif-complex |  60 +-
 tests/ref/fate/filter-w3fdif-simple  |  60 +-
 tests/ref/fate/filter-yadif-mode0|  60 +-
 tests/ref/fate/filter-yadif-mode1| 118 +--
 tests/ref/fate/filter-yadif10|  60 +-
 tests/ref/fate/filter-yadif16|  60 +-
 tests/ref/fate/mpeg2-field-enc   |  60 +-
 tests/ref/fate/mpeg2-ticket6677  |  12 ++--
 11 files changed, 321 insertions(+), 319 deletions(-)

diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
index c913504a65..5624c10629 100644
--- a/libavcodec/mpegvideo_motion.c
+++ b/libavcodec/mpegvideo_motion.c
@@ -239,20 +239,22 @@ void mpeg_motion_internal(MpegEncContext *s,
   int motion_y,
   int h,
   int is_mpeg12,
+  int is_16x8,
   int mb_y)
 {
 uint8_t *ptr_y, *ptr_cb, *ptr_cr;
 int dxy, uvdxy, mx, my, src_x, src_y,
-uvsrc_x, uvsrc_y, v_edge_pos;
+uvsrc_x, uvsrc_y, v_edge_pos, block_y_half;
 ptrdiff_t uvlinesize, linesize;
 
 v_edge_pos = s->v_edge_pos >> field_based;
 linesize   = s->current_picture.f->linesize[0] << field_based;
 uvlinesize = s->current_picture.f->linesize[1] << field_based;
+block_y_half = (field_based | is_16x8);
 
 dxy   = ((motion_y & 1) << 1) | (motion_x & 1);
 src_x = s->mb_x * 16 + (motion_x >> 1);
-src_y = (mb_y << (4 - field_based)) + (motion_y >> 1);
+src_y = (mb_y << (4 - block_y_half)) + (motion_y >> 1);
 
 if (!is_mpeg12 && s->out_format == FMT_H263) {
 if ((s->workaround_bugs & FF_BUG_HPEL_CHROMA) && field_based) {
@@ -260,7 +262,7 @@ void mpeg_motion_internal(MpegEncContext *s,
 my  = motion_y >> 1;
 uvdxy   = ((my & 1) << 1) | (mx & 1);
 uvsrc_x = s->mb_x * 8 + (mx >> 1);
-uvsrc_y = (mb_y << (3 - field_based)) + (my >> 1);
+uvsrc_y = (mb_y << (3 - block_y_half)) + (my >> 1);
 } else {
 uvdxy   = dxy | (motion_y & 2) | ((motion_x & 2) >> 1);
 uvsrc_x = src_x >> 1;
@@ -279,7 +281,7 @@ void mpeg_motion_internal(MpegEncContext *s,
 my  = motion_y / 2;
 uvdxy   = ((my & 1) << 1) | (mx & 1);
 uvsrc_x = s->mb_x * 8 + (mx >> 1);
-uvsrc_y = (mb_y << (3 - field_based)) + (my >> 1);
+uvsrc_y = (mb_y << (3 - block_y_half)) + (my >> 1);
 } else {
 if (s->chroma_x_shift) {
 // Chroma422
@@ -370,18 +372,18 @@ static void mpeg_motion(MpegEncContext *s,
 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
 int field_select, uint8_t **ref_picture,
 op_pixels_func (*pix_op)[4],
-int motion_x, int motion_y, int h, int mb_y)
+int motion_x, int motion_y, int h, int is_16x8, int 
mb_y)
 {
 #if !CONFIG_SMALL
 if (s->out_format == FMT_MPEG1)
 mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 0, 0,
  field_select, ref_picture, pix_op,
- motion_x, motion_y, h, 1, mb_y);
+ motion_x, motion_y, h, 1, is_16x8, mb_y);
 else
 #endif
 mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, 0, 0,
  field_select, ref_picture, pix_op,
- motion_x, motion_y, h, 0, mb_y);
+ motion_x, motion_y, h, 0, is_16x8, mb_y);
 }
 
 static void mpeg_motion_field(MpegEncContext *s, uint8_t *dest_y,
@@ -395,12 +397,12 @@ static void mpeg_motion_field(MpegEncContext *s, uint8_t 
*dest_y,
 if (s->out_format == FMT_MPEG1)
 

[FFmpeg-cvslog] avcodec/vp3: Check eob_run

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Feb  9 04:17:16 2018 +0100| [570023eab3e2962b4ad8345a157c1e18ca1a6eca] | 
committer: Michael Niedermayer

avcodec/vp3: Check eob_run

Fixes: out of array access
Fixes: 5919/clusterfuzz-testcase-minimized-5859311382167552
Fixes: special case for theora (untested due to lack of sample)

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=570023eab3e2962b4ad8345a157c1e18ca1a6eca
---

 libavcodec/vp3.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index cf9c57f5fa..33be345c14 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -978,6 +978,9 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext 
*gb,
 if (eob_run_get_bits[token])
 eob_run += get_bits(gb, eob_run_get_bits[token]);
 
+if (!eob_run)
+eob_run = INT_MAX;
+
 // record only the number of blocks ended in this plane,
 // any spill will be recorded in the next plane.
 if (eob_run > num_coeffs - coeff_i) {

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


[FFmpeg-cvslog] avcodec/pafvideo: Check allocated frame size

2018-02-11 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Feb  4 02:14:49 2018 +0100| [66acb630286cf1bf03bfbdab6c7c784ff20bde61] | 
committer: Michael Niedermayer

avcodec/pafvideo: Check allocated frame size

Fixes: OOM
Fixes: 5549/clusterfuzz-testcase-minimized-5390553567985664

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=66acb630286cf1bf03bfbdab6c7c784ff20bde61
---

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

diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c
index 6980ae1b35..7c5861dfaf 100644
--- a/libavcodec/pafvideo.c
+++ b/libavcodec/pafvideo.c
@@ -78,6 +78,7 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
 {
 PAFVideoDecContext *c = avctx->priv_data;
 int i;
+int ret;
 
 c->width  = avctx->width;
 c->height = avctx->height;
@@ -90,6 +91,9 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
 }
 
 avctx->pix_fmt = AV_PIX_FMT_PAL8;
+ret = av_image_check_size2(avctx->width, FFALIGN(avctx->height, 256), 
avctx->max_pixels, avctx->pix_fmt, 0, avctx);
+if (ret < 0)
+return ret;
 
 c->pic = av_frame_alloc();
 if (!c->pic)

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