From d5d1e7c4bfdba2e6cba84f8b3e8cff8816a844fc Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Jun 02 2010 15:36:36 +0000 Subject: - fix SIGSEGV in ucil_alsa_fill_audio_buffer (#572966) - fix SIGSEGV in ucil_theora_encode_thread (#595863) --- diff --git a/libucil-0.9.8-alsa.patch b/libucil-0.9.8-alsa.patch new file mode 100644 index 0000000..24f2c3d --- /dev/null +++ b/libucil-0.9.8-alsa.patch @@ -0,0 +1,30 @@ +diff --git a/src/ucil_theora.c b/src/ucil_theora.c +index 1af19d4..3f6e1ca 100644 +--- a/src/ucil_theora.c ++++ b/src/ucil_theora.c +@@ -1524,6 +1524,12 @@ ucil_theora_video_file_object_t *ucil_theora_create_video_filev( const char *pat + return NULL; + } + vobj->audio_data = ucil_alsa_init( vobj->audio_card, vobj->audio_rate ); ++ if( !vobj->audio_data ) ++ { ++ /* the error message has been already emitted */ ++ free( vobj ); ++ return NULL; ++ } + + vorbis_info_init( &vobj->vi ); + if( vorbis_encode_init( &vobj->vi, 2, vobj->audio_rate, -1, vobj->vorbis_bitrate, -1 ) ) +@@ -1540,6 +1546,12 @@ ucil_theora_video_file_object_t *ucil_theora_create_video_filev( const char *pat + else if( vobj->audio ) + { + vobj->audio_data = ucil_alsa_init( vobj->audio_card, vobj->audio_rate ); ++ if( !vobj->audio_data ) ++ { ++ /* the error message has been already emitted */ ++ free( vobj ); ++ return NULL; ++ } + } + + #endif diff --git a/libucil-0.9.8-segv.patch b/libucil-0.9.8-segv.patch new file mode 100644 index 0000000..b3b6fcd --- /dev/null +++ b/libucil-0.9.8-segv.patch @@ -0,0 +1,31 @@ +diff --git a/src/ucil_theora.c b/src/ucil_theora.c +index 3f6e1ca..7cfb0f4 100644 +--- a/src/ucil_theora.c ++++ b/src/ucil_theora.c +@@ -518,7 +518,7 @@ static void fill_frames( ucil_theora_video_file_object_t *vobj, unicap_data_buff + { + unicap_data_buffer_t *last_data_buffer; + +- last_data_buffer = (unicap_data_buffer_t *)vobj->last_frame; ++ last_data_buffer = vobj->last_frame; + if( vobj->downsize > 1 || vobj->requires_resizing_frames ) + { + yuv->y = ds_y_buffer; +@@ -690,7 +690,7 @@ static void *ucil_theora_encode_thread( ucil_theora_video_file_object_t *vobj ) + double streampos; + struct timeval streamtime; + +- last_data_buffer = (unicap_data_buffer_t *)vobj->last_frame->data; ++ last_data_buffer = vobj->last_frame; + if( vobj->downsize > 1 || vobj->requires_resizing_frames ) + { + yuv.y = ds_y_buffer; +@@ -807,7 +807,7 @@ static void *ucil_theora_encode_thread( ucil_theora_video_file_object_t *vobj ) + { + unicap_data_buffer_t *last_data_buffer; + +- last_data_buffer = (unicap_data_buffer_t *)vobj->last_frame->data; ++ last_data_buffer = vobj->last_frame; + last_data_buffer->flags &= ~UNICAP_FLAGS_BUFFER_LOCKED; + sem_wait( &vobj->lock ); + g_queue_push_head( vobj->empty_queue, vobj->last_frame ); diff --git a/libucil.spec b/libucil.spec index 7c4afe5..fd41ba6 100644 --- a/libucil.spec +++ b/libucil.spec @@ -1,11 +1,18 @@ Summary: Library to render text and graphic overlays onto video images Name: libucil Version: 0.9.8 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://www.unicap-imaging.org/ Source0: http://www.unicap-imaging.org/downloads/%{name}-%{version}.tar.gz + +# Fix commited in upstream r62 +Patch0: libucil-0.9.8-alsa.patch + +# Fix commited in upstream r61 +Patch1: libucil-0.9.8-segv.patch + BuildRequires: intltool, /usr/bin/perl, perl(XML::Parser), gettext, gtk-doc >= 1.4 BuildRequires: libunicap-devel, glib2-devel, pango-devel, alsa-lib-devel BuildRequires: libtheora-devel, libogg-devel, libvorbis-devel, libpng-devel @@ -31,9 +38,15 @@ API documentation of the library, too. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build %configure --disable-rpath --enable-gtk-doc + +# uncomment to turn off optimizations +#find -name Makefile | xargs sed -i s/-O2/-O0/ + make %{?_smp_mflags} %install @@ -63,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/gtk-doc/html/%{name} %changelog +* Wed Jun 02 2010 Kamil Dudka 0.9.8-3 +- fix SIGSEGV in ucil_alsa_fill_audio_buffer (#572966) +- fix SIGSEGV in ucil_theora_encode_thread (#595863) + * Fri Mar 12 2010 Kamil Dudka 0.9.8-2 - build the package in %%build