diff --git a/README.md b/README.md index 770ce38..36d542b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # libvpx +libvpx provides the VP8 SDK, which allows you to integrate your applications with the VP8 video codec, a high quality, royalty free, open source codec deployed on millions of computers and devices worldwide. + diff --git a/libvpx-0.9.0-no-explicit-dep-on-static-lib.patch b/libvpx-0.9.0-no-explicit-dep-on-static-lib.patch new file mode 100644 index 0000000..d909d7e --- /dev/null +++ b/libvpx-0.9.0-no-explicit-dep-on-static-lib.patch @@ -0,0 +1,11 @@ +diff -up libvpx-0.9.0/examples.mk.BAD libvpx-0.9.0/examples.mk +--- libvpx-0.9.0/examples.mk.BAD 2010-05-19 17:58:42.611058552 -0400 ++++ libvpx-0.9.0/examples.mk 2010-05-19 17:59:11.934181029 -0400 +@@ -129,7 +129,6 @@ BINS-$(NOT_MSVS) += $(addprefi + # Instantiate linker template for all examples. + CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) + $(foreach bin,$(BINS-yes),\ +- $(if $(BUILD_OBJS),$(eval $(bin): $(LIB_PATH)/lib$(CODEC_LIB).a))\ + $(if $(BUILD_OBJS),$(eval $(call linker_template,$(bin),\ + $(call objs,$($(notdir $(bin)).SRCS)) \ + -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\ diff --git a/libvpx-0.9.5-I6266aba7.patch b/libvpx-0.9.5-I6266aba7.patch new file mode 100644 index 0000000..299a1e9 --- /dev/null +++ b/libvpx-0.9.5-I6266aba7.patch @@ -0,0 +1,73 @@ +From 9fb80f7170ec48e23c3c7b477149eeb37081c699 Mon Sep 17 00:00:00 2001 +From: John Koleszar +Date: Thu, 4 Nov 2010 16:59:26 -0400 +Subject: [PATCH] fix integer promotion bug in partition size check + +The check '(user_data_end - partition < partition_size)' must be +evaluated as a signed comparison, but because partition_size was +unsigned, the LHS was promoted to unsigned, causing an incorrect +result on 32-bit. Instead, check the upper and lower bounds of +the segment separately. + +Change-Id: I6266aba7fd7de084268712a3d2a81424ead7aa06 +--- + vp8/decoder/decodframe.c | 6 ++++-- + vp8/vp8_dx_iface.c | 10 ++++++++-- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c +index 2d81d61..f5e49a1 100644 +--- a/vp8/decoder/decodframe.c ++++ b/vp8/decoder/decodframe.c +@@ -462,7 +462,8 @@ static void setup_token_decoder(VP8D_COMP *pbi, + partition_size = user_data_end - partition; + } + +- if (user_data_end - partition < partition_size) ++ if (partition + partition_size > user_data_end ++ || partition + partition_size < partition) + vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, + "Truncated packet or corrupt partition " + "%d length", i + 1); +@@ -580,7 +581,8 @@ int vp8_decode_frame(VP8D_COMP *pbi) + (data[0] | (data[1] << 8) | (data[2] << 16)) >> 5; + data += 3; + +- if (data_end - data < first_partition_length_in_bytes) ++ if (data + first_partition_length_in_bytes > data_end ++ || data + first_partition_length_in_bytes < data) + vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME, + "Truncated packet or corrupt partition 0 length"); + vp8_setup_version(pc); +diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c +index e7e5356..f0adf5b 100644 +--- a/vp8/vp8_dx_iface.c ++++ b/vp8/vp8_dx_iface.c +@@ -253,8 +253,11 @@ static vpx_codec_err_t vp8_peek_si(const uint8_t *data, + unsigned int data_sz, + vpx_codec_stream_info_t *si) + { +- + vpx_codec_err_t res = VPX_CODEC_OK; ++ ++ if(data + data_sz <= data) ++ res = VPX_CODEC_INVALID_PARAM; ++ else + { + /* Parse uncompresssed part of key frame header. + * 3 bytes:- including version, frame type and an offset +@@ -331,7 +334,10 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx, + + ctx->img_avail = 0; + +- /* Determine the stream parameters */ ++ /* Determine the stream parameters. Note that we rely on peek_si to ++ * validate that we have a buffer that does not wrap around the top ++ * of the heap. ++ */ + if (!ctx->si.h) + res = ctx->base.iface->dec.peek_si(data, data_sz, &ctx->si); + +-- +1.7.3.1 + diff --git a/libvpx.pc b/libvpx.pc new file mode 100644 index 0000000..0ec05c5 --- /dev/null +++ b/libvpx.pc @@ -0,0 +1,14 @@ +prefix=@PREFIX@ +exec_prefix=@PREFIX@ +libdir=@LIBDIR@ +includedir=@INCLUDEDIR@ + +Name: libvpx +Description: VP8 Video Codec SDK library +Version: 0.9.1 +URL: http://www.webmproject.org/tools/vp8-sdk/ +Requires: +Conflicts: +Libs: -L${libdir} -lvpx +Libs.private: +Cflags: -I${includedir}/vpx/ diff --git a/libvpx.spec b/libvpx.spec new file mode 100644 index 0000000..30fe948 --- /dev/null +++ b/libvpx.spec @@ -0,0 +1,159 @@ +%ifarch %{ix86} +%define vpxtarget x86-linux-gcc +%else +%ifarch x86_64 +%define vpxtarget x86_64-linux-gcc +%else +%ifarch arm +%define vpxtarget armv5te-linux-gcc +%else +%define vpxtarget generic-gnu +%endif +%endif +%endif + +%define majver %(echo %version | cut -d. -f 1-2) +%define major %(echo %version | cut -d. -f -1) + +Name: libvpx +Version: 1.3.0 +Release: 1mamba +Summary: VP8 Video Codec SDK +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://code.google.com/p/webm +Source0: https://webm.googlecode.com/files/libvpx-v%{version}.tar.bz2 +Source1: libvpx.pc +# from debian +Source2: libvpx.ver +Patch0: libvpx-0.9.0-no-explicit-dep-on-static-lib.patch +Patch1: libvpx-0.9.5-I6266aba7.patch +License: BSD +BuildRequires: doxygen +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +## AUTOBUILDREQ-END +%if "%{stage1}" != "1" +BuildRequires: php +# TODO BuildRequires: %{_bindir}/php-cli +%endif +BuildRequires: yasm +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +libvpx provides the VP8 SDK, which allows you to integrate your applications with the VP8 video codec, a high quality, royalty free, open source codec deployed on millions of computers and devices worldwide. + +%package devel +Group: Development/Libraries +Summary: Static libraries and headers for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description devel +libvpx - VP8 Video Codec SDK. + +This package contains static libraries and header files need for development. + +%package utils +Group: Development/Tools +Summary: Utility applications for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description utils +libvpx - VP8 Video Codec SDK. + +The %{name}-tools package contains a selection of utilities and +tools for VP8, including a sample encoder and decoder. + +%package docs +Group: Documentation +Summary: libvpx API documentation + +%description docs +libvpx - VP8 Video Codec SDK. + +This package contains libvpx API documentation. + +%prep +%setup -q -n %{name}-v%{version} + +%build +CROSS=%{_host}- \ +./configure \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --enable-pic \ + --disable-install-srcs \ +%if "%{stage1}" !="1" + --enable-install-docs \ +%endif + --enable-shared \ + --target=%{vpxtarget} + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +# fix permissions +chmod 644 %{buildroot}%{_includedir}/vpx/*.h + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_libdir}/libvpx.so.* +%doc AUTHORS LICENSE + +%files devel +%defattr(-,root,root) +%dir %{_includedir}/vpx +%{_includedir}/vpx/*.h +%{_libdir}/libvpx.a +%{_libdir}/libvpx.so +%{_libdir}/pkgconfig/vpx.pc +%doc CHANGELOG README + +%files utils +%defattr(-,root,root) +%{_bindir}/vp8_scalable_patterns +%{_bindir}/vp9_spatial_scalable_encoder +%{_bindir}/vpxdec +%{_bindir}/vpxenc + +#%if "%{stage1}" !="1" +#%files docs +#%defattr(-,root,root) +##%doc docs/html/ +#%endif + +%changelog +* Sun Jan 12 2014 Automatic Build System 1.3.0-1mamba +- automatic version update by autodist + +* Thu Oct 17 2013 Silvan Calarco 1.2.0-2mamba +- fix permissions of header files + +* Wed Sep 04 2013 Automatic Build System 1.2.0-1mamba +- automatic version update by autodist + +* Wed Nov 14 2012 Silvan Calarco 1.1.0-1mamba +- update to 1.1.0 + +* Tue Aug 02 2011 Silvan Calarco 0.9.6-3mamba +- rebuilt in devel + +* Fri Mar 18 2011 gil 0.9.6-2mamba +- fix broken header files + +* Fri Mar 18 2011 gil 0.9.6-1mamba +- update to 0.9.6 + +* Fri Feb 25 2011 gil 0.9.5-1mamba +- package created by autospec diff --git a/libvpx.ver b/libvpx.ver new file mode 100644 index 0000000..d4b6ec2 --- /dev/null +++ b/libvpx.ver @@ -0,0 +1,56 @@ +{ global: +vpx_codec_build_config; +vpx_codec_control_; +vpx_codec_dec_init_ver; +vpx_codec_decode; +vpx_codec_destroy; +vpx_codec_enc_config_default; +vpx_codec_enc_config_set; +vpx_codec_enc_init_ver; +vpx_codec_encode; +vpx_codec_error; +vpx_codec_error_detail; +vpx_codec_err_to_string; +vpx_codec_get_caps; +vpx_codec_get_cx_data; +vpx_codec_get_frame; +vpx_codec_get_global_headers; +vpx_codec_get_mem_map; +vpx_codec_get_preview_frame; +vpx_codec_get_stream_info; +vpx_codec_iface_name; +vpx_codec_peek_stream_info; +vpx_codec_register_put_frame_cb; +vpx_codec_register_put_slice_cb; +vpx_codec_set_cx_data_buf; +vpx_codec_set_mem_map; +vpx_codec_version; +vpx_codec_version_extra_str; +vpx_codec_version_str; +vpx_codec_vp8_algo; +vpx_codec_vp8_cx_algo; +vpx_codec_vp8_dx_algo; +vpx_dec_control; +vpx_dec_decode; +vpx_dec_destroy; +vpx_dec_error; +vpx_dec_error_detail; +vpx_dec_err_to_string; +vpx_dec_get_caps; +vpx_dec_get_frame; +vpx_dec_get_mem_map; +vpx_dec_get_stream_info; +vpx_dec_iface_name; +vpx_dec_init_ver; +vpx_dec_peek_stream_info; +vpx_dec_register_put_frame_cb; +vpx_dec_register_put_slice_cb; +vpx_dec_set_mem_map; +vpx_dec_xma_init_ver; +vpx_enc_vp8_algo; +vpx_img_alloc; +vpx_img_flip; +vpx_img_free; +vpx_img_set_rect; +vpx_img_wrap; +local: *; };