Mikko Rapeli [Wed, 25 Jul 2012 15:15:49 +0000 (17:15 +0200)]
Fix calloc() parameter ordering
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.
Mikko Rapeli [Wed, 25 Jul 2012 15:50:45 +0000 (17:50 +0200)]
mlt_playlist_init(): check return values from mlt_producer_init() and calloc()
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)".
73 mlt_producer_init( producer, self );
Mikko Rapeli [Wed, 25 Jul 2012 09:58:58 +0000 (11:58 +0200)]
mlt_filter.c: fix possible buffer overflows
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.
257 strcat( name, unique_id );
and
CID 709412: 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.
302 strcat( name, unique_id );
Mikko Rapeli [Wed, 25 Jul 2012 09:57:29 +0000 (11:57 +0200)]
mlt_filter_new(): check return value from mlt_filter_init()
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)".
78 mlt_filter_init( self, NULL );
79 return self;
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’
Mikko Rapeli [Tue, 24 Jul 2012 17:55:47 +0000 (19:55 +0200)]
mlt_consumer_start(): check return value from mlt_properties_get_int()
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
442 int frame_duration = 1000000 / mlt_properties_get_int( properties, "frame_rate_num" ) *
443 mlt_properties_get_int( properties, "frame_rate_den" );
Mikko Rapeli [Tue, 24 Jul 2012 17:35:14 +0000 (19:35 +0200)]
mlt_consumer_new(): handle return value from mlt_consumer_init()
If init() fails return NULL. Fixes Coverity CID 709325.
At conditional (1): "self != NULL" taking the true branch.
339 if ( 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 11 times).
No check of the return value of "mlt_consumer_init(self, NULL, profile)".
340 mlt_consumer_init( self, NULL, profile );
Mikko Rapeli [Mon, 2 Jul 2012 18:39:46 +0000 (21:39 +0300)]
riff.cc: Initialize data in constructor
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 class member ""offset"" is not initialized in this constructor nor in any functions that it calls.
Non-static class member ""parent"" is not initialized in this constructor nor in any functions that it calls.
Non-static class member ""type"" is not initialized in this constructor nor in any functions that it calls.
Non-static class member ""written"" is not initialized in this constructor nor in any functions that it calls.
Dan Dennedy [Fri, 22 Jun 2012 04:22:31 +0000 (21:22 -0700)]
send jack silence on buffer underrun
This occurs with the sdl_preview or any of the audio-only consumers when
paused. Otherwise, jack just plays unset memory, which is usually
something worse than just noise.
Dan Dennedy [Sun, 17 Jun 2012 05:12:03 +0000 (22:12 -0700)]
overhaul a/v sync and seeking in avformat producer
The new_seek property changed to use_pts. This consolidates old seek and
new seek code, improves a/v sync for more files, and improves seek
performance for AVCHD in general (including libav).