[Mlt-devel] crash on missing sox effect name [PATCH]
Brought to you by:
ddennedy,
lilo_booter
From: j-b-m <j-...@us...> - 2008-12-28 14:52:32
|
Hi. Currently, MLT crashes if we give a wrong or missing sox effect name. For example: inigo test.mp3 -attach sox:"vibro" crashes with a segfault (vibro effect does not exist anymore in sox). Patch below fixes the crash. regards jb Index: filter_sox.c =================================================================== --- filter_sox.c (revision 1295) +++ filter_sox.c (working copy) @@ -106,7 +106,9 @@ #ifdef SOX14 //fprintf(stderr, "%s: effect %s count %d\n", __FUNCTION__, tokeniser- >tokens[0], tokeniser->count ); #if (ST_LIB_VERSION_CODE >= ST_LIB_VERSION(14,1,0)) - eff_t eff = sox_create_effect( sox_find_effect( tokeniser->tokens[0] ) ); + sox_effect_handler_t const *eff_handle = sox_find_effect( tokeniser- >tokens[0] ); + if (eff_handle == NULL ) return error; + eff_t eff = sox_create_effect( eff_handle ); effect_destructor = ( mlt_destructor ) delete_effect; sox_encodinginfo_t *enc = calloc( 1, sizeof( sox_encodinginfo_t ) ); enc->encoding = SOX_ENCODING_SIGN2; |