Re: [Mlt-devel] Fix crash on invalid image sequence
Brought to you by:
ddennedy,
lilo_booter
From: j-b-m <j-...@us...> - 2012-11-15 01:52:31
|
On Thursday 15 November 2012 02:47:09 j-b-m wrote: > Hi, > > There seems to be a memory allocation issue in the image sequence loader > that can produce a crash. I can reproduce with: Oh, I sent it before having time to finish... So the crash is reproducible with: melt image%05d.jpg Where image%05d.jpg does not exist. Crash can be fixed for me with the patch below. regards jb _____________________________________________________________________________ diff --git a/src/modules/gtk2/producer_pixbuf.c b/src/modules/gtk2/producer_pixbuf.c index dbece63..782a645 100644 --- a/src/modules/gtk2/producer_pixbuf.c +++ b/src/modules/gtk2/producer_pixbuf.c @@ -212,7 +212,7 @@ static int load_sequence_deprecated( producer_pixbuf self, mlt_properties pro strncpy( s, start, n ); mlt_properties_set( properties, "begin", s ); free( s ); - s = calloc( 1, strlen( filename ) ); + s = calloc( strlen( filename ) , sizeof( char* ) ); strncpy( s, filename, start - filename ); sprintf( s + ( start - filename ), ".%d%s", n, end ); result = load_sequence_sprintf( self, properties, s ); diff --git a/src/modules/qimage/producer_qimage.c b/src/modules/qimage/producer_qimage.c index 98d6f47..0f760bf 100644 --- a/src/modules/qimage/producer_qimage.c +++ b/src/modules/qimage/producer_qimage.c @@ -157,7 +157,7 @@ static int load_sequence_deprecated( producer_qimage self, mlt_properties pro strncpy( s, start, n ); mlt_properties_set( properties, "begin", s ); free( s ); - s = calloc( 1, strlen( filename ) ); + s = calloc( strlen( filename ) , sizeof( char* ) ); strncpy( s, filename, start - filename ); sprintf( s + ( start - filename ), ".%d%s", n, end ); result = load_sequence_sprintf( self, properties, s ); |