Re: [Mlt-devel] [PATCH 0/8] Few more Coverity fixes

2012-07-25 Thread Mikko Rapeli
On Wed, Jul 25, 2012 at 03:41:12PM -0700, Dan Dennedy wrote: > I thought you are using github now. Yeah, wasn't sure if you wanted to review over email. But pull request it is then :) -Mikko -- Live Security Virtual Conf

[Mlt-devel] [PATCH 8/8] Fix calloc() parameter ordering

2012-07-25 Thread Mikko Rapeli
First parameter to calloc() is the count and second the amount of bytes for each item. Likely this has no run time effect since the resulting buffer size is the same. --- src/framework/mlt_field.c |4 ++-- src/framework/mlt_frame.c |2 +- src/framework/m

[Mlt-devel] [PATCH 6/8] mlt_producer_seek(): check that eof is not NULL

2012-07-25 Thread Mikko Rapeli
Fixes Coverity CID 709348: Dereference after null check (FORWARD_NULL) Comparing "eof" to null implies that "eof" might be null. 310else if ( use_points && ( eof == NULL || !strcmp( eof, "pause" ) ) && position >= mlt_producer_get_playtime( self ) ) 311{ 312mlt_p

[Mlt-devel] [PATCH 3/8] mlt_frame_get_waveform(): handle memory allocation failure

2012-07-25 Thread Mikko Rapeli
Fixes Coverity CID 709347. At conditional (1): "bitmap != NULL" taking the false branch. CID 709347: Dereference after null check (FORWARD_NULL) Comparing "bitmap" to null implies that "bitmap" might be null. 802if ( bitmap != NULL ) 803memset( bitmap, 0, size ); 804

[Mlt-devel] [PATCH 5/8] mlt_producer_new(): check return value from mlt_producer_init()

2012-07-25 Thread Mikko Rapeli
--- src/framework/mlt_producer.c |5 + 1 file changed, 5 insertions(+) diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index b379581..8476d82 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -156,6 +156,11 @@ mlt_producer mlt_produce

[Mlt-devel] [PATCH 7/8] mlt_property_get_time(): get mutex before accessing self->types

2012-07-25 Thread Mikko Rapeli
Fixes Coverity CID 709356: Data race condition (MISSING_LOCK) Accessing variable "self->types" (mlt_property_s.types) requires the mlt_property_s.mutex lock. 871self->types |= mlt_prop_string; --- src/framework/mlt_property.c | 10 ++ 1 file changed, 10 insertions(+) di

[Mlt-devel] [PATCH 1/8] mlt_filter_new(): check return value from mlt_filter_init()

2012-07-25 Thread Mikko Rapeli
Fixes Coverity CID 709326: Unchecked return value (CHECKED_RETURN) Calling function "mlt_filter_init" without checking return value (as is done elsewhere 7 out of 8 times). No check of the return value of "mlt_filter_init(self, NULL)". 78mlt_filter_init( self, NULL ); 79r

[Mlt-devel] [PATCH 0/8] Few more Coverity fixes

2012-07-25 Thread Mikko Rapeli
Tested briefly on top of the vdpau changes with one of my editing projects. Kdenlive and melt seem to work as before. Last one just seemed a bit odd so I cleaned that up as well. Mikko Rapeli (8): mlt_filter_new(): check return value from mlt_filter_init() mlt_filter.c: fix possible buffer

[Mlt-devel] [PATCH 4/8] mlt_playlist_init(): check return values from mlt_producer_init() and calloc()

2012-07-25 Thread Mikko Rapeli
Fixes Coverity CID 709327: Unchecked return value (CHECKED_RETURN) Calling function "mlt_producer_init" without checking return value (as is done elsewhere 17 out of 20 times). No check of the return value of "mlt_producer_init(producer, self)". 73mlt_producer_init( producer, sel

[Mlt-devel] [PATCH 2/8] mlt_filter.c: fix possible buffer overflows

2012-07-25 Thread Mikko Rapeli
Fixes Coverity CID 709411: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 20 byte fixed-size string "name" by copying "unique_id" without checking the length. 257strcat( name, unique_id ); and CID 709412: Copy into fixed size buffer (STRING_OVERFLOW) You might overru

[Mlt-devel] [PATCH] vdpau: reduce runtime detection cost

2012-07-25 Thread Mikko Rapeli
Don't try to dlopen() every time, once is enough. --- src/modules/avformat/vdpau.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/src/modules/avformat/vdpau.c b/src/modules/avformat/vdpau.c index c4ae33a..a98b176 100644 --- a/src/modules/avformat/vdpau.c +++ b/src/modules/avformat/vd

[Mlt-devel] [PATCH 0/2] vdpau fixes

2012-07-25 Thread Mikko Rapeli
These patches are needed to compile on Debian unstable with debian-multimedia.org packages. Hopefully they are generic enough to not break compilation or functionality with older library versions. I don't have nvidia GPU so I could not properly test these. Christian Marillat (2): vdpau compilati

[Mlt-devel] [PATCH 2/2] Fix vdpau library paths

2012-07-25 Thread Mikko Rapeli
From: Christian Marillat They have changed in Debian. --- src/modules/avformat/vdpau.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/avformat/vdpau.c b/src/modules/avformat/vdpau.c index 7756cc0..c4ae33a 100644 --- a/src/modules/avformat/vdpau.c ++

[Mlt-devel] [PATCH 1/2] vdpau compilation fix

2012-07-25 Thread Mikko Rapeli
From: Christian Marillat In file included from producer_avformat.c:157:0: vdpau.c: In function ‘vdpau_get_buffer’: vdpau.c:162:10: error: ‘AVFrame’ has no member named ‘age’ vdpau.c:169:10: error: ‘AVFrame’ has no member named ‘age’ --- src/modules/avformat/vdpau.c |2 -- 1 file changed, 2 d

[Mlt-devel] [PATCH 4/8] mlt_cache.c: watch out for null pointer

2012-07-24 Thread Mikko Rapeli
Fixes Coverity CID 709346: Dereference after null check (FORWARD_NULL) Comparing "result" to null implies that "result" might be null. 449if ( result && result->data ) 450result->refcount++; Dereferencing null variable "result". 451mlt_log( NU

[Mlt-devel] [PATCH 6/8] mlt_consumer_new(): handle return value from mlt_consumer_init()

2012-07-24 Thread Mikko Rapeli
If init() fails return NULL. Fixes Coverity CID 709325. At conditional (1): "self != NULL" taking the true branch. 339if ( self != NULL ) CID 709325: Unchecked return value (CHECKED_RETURN) Calling function "mlt_consumer_init" without checking return value (as is done elsewhere 10 out of

[Mlt-devel] [PATCH 2/8] riff.cc: Fail if lseek() fails

2012-07-24 Thread Mikko Rapeli
Fixes Coverity CID 709362: Argument cannot be negative (NEGATIVE_RETURNS) Function "lseek(this->fd, 0LL, 0)" returns a negative number. Assigning: signed variable "pos" = "lseek". ... "pos" is passed to a parameter that cannot be negative. 548fail_if( lseek( fd, pos, SEEK_SET ) == (

[Mlt-devel] [PATCH 7/8] mlt_consumer_start(): get mutex before accessing put_active

2012-07-24 Thread Mikko Rapeli
Fixes Coverity CID 709355: Data race condition (MISSING_LOCK) Accessing variable "self->put_active" (mlt_consumer_s.put_active) requires the mlt_consumer_s.put_mutex lock. 411self->put_active = 1; --- src/framework/mlt_consumer.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/s

[Mlt-devel] [PATCH 8/8] mlt_consumer_start(): check return value from mlt_properties_get_int()

2012-07-24 Thread Mikko Rapeli
Fixes Coverity CID 709343: Division or modulo by zero (DIVIDE_BY_ZERO) Division by expression "mlt_properties_get_int(properties, "frame_rate_num")" which may be zero has undefined behavior On this path, function call "mlt_properties_get_int(properties, "frame_rate_num")" has return value of 0 4

[Mlt-devel] [PATCH 0/8] A few Coverity fixes

2012-07-24 Thread Mikko Rapeli
Tested these with kdenlive and nothing seems to break. Mikko Rapeli (8): riff.cc: Initialize data in constructor riff.cc: Fail if lseek() fails mlt_cache.c: check for null pointer mlt_cache.c: watch out for null pointer mlt_consumer.c: watch out for null pointer mlt_consumer_new

[Mlt-devel] [PATCH 5/8] mlt_consumer.c: watch out for null pointer

2012-07-24 Thread Mikko Rapeli
Fixes Coverity CID 709393: Dereference before null check (REVERSE_INULL) Directly dereferencing pointer "profile". 235profile->sample_aspect_num = mlt_properties_get_int( properties, "sample_aspect_num" ); Dereferencing "profile" before a null check. 236if ( profi

[Mlt-devel] [PATCH 3/8] mlt_cache.c: check for null pointer

2012-07-24 Thread Mikko Rapeli
Fixes CID 709392: Dereference before null check (REVERSE_INULL). --- src/framework/mlt_cache.c |1 + 1 file changed, 1 insertion(+) diff --git a/src/framework/mlt_cache.c b/src/framework/mlt_cache.c index 7938f79..5a15868 100644 --- a/src/framework/mlt_cache.c +++ b/src/framework/mlt_cache.c

[Mlt-devel] [PATCH 1/8] riff.cc: Initialize data in constructor

2012-07-24 Thread Mikko Rapeli
Fixes Coverity CID 709444: Uninitialized scalar field (UNINIT_CTOR) Non-static class member ""length"" is not initialized in this constructor nor in any functions that it calls. Non-static class member ""name"" is not initialized in this constructor nor in any functions that it calls. Non-static

[Mlt-devel] [PATCH 1/2] Fix kdenlive playback crash

2012-07-23 Thread Mikko Rapeli
mlt_deque functions can now be called with 0x0 self so try to deal with them. Fixes this crash when previewing project in kdenlive: No locals. buffer=buffer@entry=0xa387b300, format=format@entry=0xa387b2f4, width=width@entry=0xa387ae94, height=height@entry=0xa387ae98, writable=writable

[Mlt-devel] [PATCH 0/2] Fix kdenlive playback crash

2012-07-23 Thread Mikko Rapeli
Hello, It's great to see some Coverity fixes coming in, but one of them introduced a crash which I tried to fix here. Don't know if it's the right approach though. At least I can now continue testing my Coverity fixes as well. Mikko Rapeli (2): Fix kdenlive playback crash In

[Mlt-devel] [PATCH 2/2] Initialize struct to zero when allocating

2012-07-23 Thread Mikko Rapeli
Just to be on the safe side. --- src/framework/mlt_deque.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/framework/mlt_deque.c b/src/framework/mlt_deque.c index 2c20979..3234fa2 100644 --- a/src/framework/mlt_deque.c +++ b/src/framework/mlt_deque.c @@ -61,7 +61,7 @@ st

Re: [Mlt-devel] 32bit failures

2012-07-23 Thread Mikko Rapeli
On Mon, Jul 23, 2012 at 10:37:13AM +0200, j-b-m wrote: > On Sunday 22 July 2012 15:59:37 Dan Dennedy wrote: > > On Sat, Jul 21, 2012 at 7:23 AM, Brian Matherly wrote: > > > Dan, > > > > > > All 32bit builds are failing. Looks like something related to the sse2 > > > changes. > > > > fixed > > I

Re: [Mlt-devel] Coverity scan

2012-06-29 Thread Mikko Rapeli
On Fri, Jun 29, 2012 at 09:07:16AM -0700, Dan Dennedy wrote: > I already looked into and inquired to start the process about a month > ago, but I have not made the changes required. Great! As a mlt/kdenlive user I'm ready to help if there's something in makefiles/configure scripts to fix, and with

[Mlt-devel] Coverity scan

2012-06-29 Thread Mikko Rapeli
Hi Dan and others, How about registering MLT to Coverity scan program to get some static analysis runs and results? http://scan.coverity.com/developers-faq.html If you are too busy, I can try to handle the process but only with your permission. Regards, -Mikko

Re: [Mlt-devel] [Kdenlive-devel] kthumb crash? (was Re: [PATCH mlt] Clear audio and video context to NULL)

2011-10-12 Thread Mikko Rapeli
On Wed, Oct 12, 2011 at 10:25:57AM -0700, Dan Dennedy wrote: > On Tue, Oct 11, 2011 at 11:02 PM, Mikko Rapeli wrote: > > On Tue, Oct 11, 2011 at 03:32:57PM -0700, Dan Dennedy wrote: > >> Can you please test with this experiment? > >> put a retu

[Mlt-devel] kthumb crash? (was Re: [PATCH mlt] Clear audio and video context to NULL)

2011-10-11 Thread Mikko Rapeli
On Tue, Oct 11, 2011 at 02:16:14PM -0700, Dan Dennedy wrote: > On Tue, Oct 11, 2011 at 2:05 PM, Mikko Rapeli wrote: > > Previewed clip without proxy and then enabled proxy back on in kdenlive. > > I think context can be NULL after return from pthread_mutex_lock() at any > >

Re: [Mlt-devel] [PATCH mlt] Clear audio and video context to NULL

2011-10-11 Thread Mikko Rapeli
Previewed clip without proxy and then enabled proxy back on in kdenlive. I think context can be NULL after return from pthread_mutex_lock() at any time and that would need to be checked everywhere. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x4ac6db70 (LWP 11245)] 0x

Re: [Mlt-devel] [PATCH mlt] Clear audio and video context to NULL

2011-10-09 Thread Mikko Rapeli
On Sun, Oct 09, 2011 at 03:32:49PM -0700, Dan Dennedy wrote: > OK, it sounds like you were setting in and out points for clips that > already have proxies. Correct? Was there any background processing > going on as well that you recall? Notice that the crash derives from > some activity in kthumb.

Re: [Mlt-devel] [PATCH mlt] Clear audio and video context to NULL

2011-10-09 Thread Mikko Rapeli
On Sat, Oct 08, 2011 at 01:27:45PM -0700, Dan Dennedy wrote: > On Sat, Oct 8, 2011 at 12:39 PM, Mikko Rapeli wrote: > > Another crash around the same area. Would you by chance have an idea of a > > fix? > > Can you determine if Kdenlive is trying to actively use 10 o

Re: [Mlt-devel] [PATCH mlt] Clear audio and video context to NULL

2011-10-08 Thread Mikko Rapeli
Another crash around the same area. Would you by chance have an idea of a fix? (gdb) bt full format=0x7c6fe1a4, width=0x7c6fdd4c, height=0x7c6fdd50, writable=0) at producer_avformat.c:1259 self = 0x54e1c400 producer = 0xaab5ccf8 frame_propert

[Mlt-devel] [PATCH mlt] Clear audio and video context to NULL

2011-10-04 Thread Mikko Rapeli
Could maybe fix this: Program received signal SIGABRT, Aborted. [Switching to Thread 0x3a0ffb70 (LWP 20895)] 0xb7fe2424 in __kernel_vsyscall () (gdb) thread apply all bt full Thread 174 (Thread 0x3a0ffb70 (LWP 20895)): No symbol table info available. at ../nptl/sysdeps/unix/sysv/linux/raise.c

[Mlt-devel] [PATCH mlt] Try to fix crash

2011-09-29 Thread Mikko Rapeli
http://www.kdenlive.org/mantis/view.php?id=2326 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x3fa37b70 (LWP 31106)] 0xb0e1852a in producer_get_image (frame=0x93c98e0, buffer=0x3fa3731c, format=0x3fa37310, width=0x3fa370c4, height=0x3fa370c8, writable=0) at pro

Re: [Mlt-devel] [PATCH 1/2 mlt] Try to fix another crash

2011-09-29 Thread Mikko Rapeli
On Thu, Sep 29, 2011 at 12:39:32PM -0700, Dan Dennedy wrote: > The sole purpose of avformat_lock and avformat_unlock is to protect > non-thread-safe libavcodec/libavformat functions. From other usages of > avformat_lock, one can determine that av_close_input_file() is unsafe, > and this fixes that.

Re: [Mlt-devel] [PATCH 1/2 mlt] Try to fix another crash

2011-09-28 Thread Mikko Rapeli
On Wed, Sep 28, 2011 at 04:23:25PM -0700, Dan Dennedy wrote: > On Wed, Sep 28, 2011 at 4:13 PM, Dan Dennedy wrote: > > On Wed, Sep 28, 2011 at 12:46 PM, Mikko Rapeli wrote: > >> Similar problem was crashing in audio codec > > > > This patch you provided is for video

Re: [Mlt-devel] [FFmpeg-devel] [PATCH ffmpeg] Try to fix kdenlive crash

2011-09-28 Thread Mikko Rapeli
On Wed, Sep 28, 2011 at 10:39:38PM +0200, Michael Niedermayer wrote: > On Wed, Sep 28, 2011 at 10:42:01PM +0300, Mikko Rapeli wrote: > > Program received signal SIGSEGV, Segmentation fault. > > [Switching to Thread 0x557feb70 (LWP 21733)] > > 0xb052d0fd in avcodec_decode_vid

[Mlt-devel] [PATCH 2/2] Try to fix another crash

2011-09-28 Thread Mikko Rapeli
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x3fa37b70 (LWP 31106)] 0xb0e1852a in producer_get_image (frame=0x93c98e0, buffer=0x3fa3731c, format=0x3fa37310, width=0x3fa370c4, height=0x3fa370c8, writable=0) at producer_avformat.c:1319 1319int must_de

[Mlt-devel] [PATCH 1/2 mlt] Try to fix another crash

2011-09-28 Thread Mikko Rapeli
Similar problem was crashing in audio codec --- src/modules/avformat/producer_avformat.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 194fb15..1f33c37 100644 --- a/src/modules

Re: [Mlt-devel] melt memory usage

2010-07-26 Thread Mikko Rapeli
On Mon, Jul 26, 2010 at 10:20:32PM -0700, Dan Dennedy wrote: > On Mon, Jul 26, 2010 at 11:48 AM, Mikko Rapeli wrote: > > I've run out of memory quite a few times lately with 1 GB of RAM and 2 GB > > swap. > > Kdenlive takes just around one GB of memory when the pr

[Mlt-devel] melt memory usage

2010-07-26 Thread Mikko Rapeli
I've run out of memory quite a few times lately with 1 GB of RAM and 2 GB swap. Kdenlive takes just around one GB of memory when the project is open but melt rendering is taking almost two, and having both of them running kicks in the OOM killer. Any ideas where this might come from, or if this is

Re: [Mlt-devel] [iss...@roundup.ffmpeg.org: [issue2092] crash at libswscale/rgb2rgb_template.c:1370]

2010-07-15 Thread Mikko Rapeli
On Thu, Jul 15, 2010 at 10:16:29AM -0700, Dan Dennedy wrote: > On Thu, Jul 15, 2010 at 8:50 AM, Mikko Rapeli wrote: > > On Wed, Jul 14, 2010 at 11:48:31PM -0700, Dan Dennedy wrote: > >> On Tue, Jul 13, 2010 at 3:31 PM, Mikko Rapeli wrote: > >> > Hello, > &

Re: [Mlt-devel] [iss...@roundup.ffmpeg.org: [issue2092] crash at libswscale/rgb2rgb_template.c:1370]

2010-07-15 Thread Mikko Rapeli
On Wed, Jul 14, 2010 at 11:48:31PM -0700, Dan Dennedy wrote: > On Tue, Jul 13, 2010 at 3:31 PM, Mikko Rapeli wrote: > > Hello, > > > > Just hit this bug with kdenlive and repeated with melt. Backtrace points to > > libswscale but maybe there's something going bad i

[Mlt-devel] [iss...@roundup.ffmpeg.org: [issue2092] crash at libswscale/rgb2rgb_template.c:1370]

2010-07-13 Thread Mikko Rapeli
Hello, Just hit this bug with kdenlive and repeated with melt. Backtrace points to libswscale but maybe there's something going bad in mlt too. I'm using latest ffmpeg and mlt from git. -Mikko --- Begin Message --- New submission from mcfrisk : Editing dnxhd files in kdenlive and playing same f