From: Good Guy Date: Tue, 18 Jul 2017 14:36:26 +0000 (-0600) Subject: bunch-o compiler bitch'n X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=58d99c74e65066486dbebf7e1cb3087e7de1c92b bunch-o compiler bitch'n --- diff --git a/cinelerra-5.1/cfg-cv.sh b/cinelerra-5.1/cfg-cv.sh index 5efad07d..3ae46732 100755 --- a/cinelerra-5.1/cfg-cv.sh +++ b/cinelerra-5.1/cfg-cv.sh @@ -5,7 +5,10 @@ cin="$1" THIRDPARTY=`pwd`/thirdparty unset LIBS LDFLAGS CFLAGS CPPFLAGS CXXFLAGS - +export ac_cv_header_xmmintrin_h=no +for f in ./quicktime/Makefile.am ./libmpeg3/Makefile.am; do + sed -e 's/-Wl,--no-undefined//' -i $f +done rm -rf thirdparty; cp -a $cin/thirdparty . for f in configure.ac Makefile.am autogen.sh; do mv $f $f.cv; cp -a $cin/$f .; done mv m4 m4.cv @@ -83,7 +86,6 @@ echo LDFLAGS=$LDFLAGS echo LIBS=$LIBS echo CFLAGS=$CFLAGS -export ac_cv_header_xmmintrin_h=no # -lmxxxxx dies, feed it a -lm early to prevent misformed parameters export LIBS="-la52 -ldjbfft -lfaac -lfaad -lHalf -lIex -lIexMath -lIlmThread -lImath -llavfile -llavjpeg -lm -lmjpegutils -lmmxsse -lmp3lame -lmp4ff -lmpeg2encpp -lmpgdecoder -lmplex2 -logg -lvorbis -lvorbisenc -lvorbisfile -lx264 -lyuvfilters -lpthread -ldl" # po Makefile construction error: skip it @@ -96,11 +98,15 @@ find thirdparty/ -name .libs | while read f ; do ( cd $f; ln -s . .libs ); done ./configure +echo "Run:" +echo "export ac_cv_header_xmmintrin_h=no" +echo "export THIRDPARTY=\"$THIRDPARTY\"" exit # have to rebuild these by hand -# cd plugins/libeffecttv/.libs/; rm libeffectv.a; ar r libeffecttv.a effecttv.o -# cd quicktime/encore50/.libs/; rm libencore.a; ar r libencore.a *.o +# have to get rid of -Wl,--no-undefined" +# cd plugins/libeffecttv/.libs/; \rm -f libeffecttv.a; ar r libeffecttv.a effecttv.o +# cd quicktime/encore50/.libs/; \rm -f libencore.a; ar r libencore.a *.o # cd quicktime; vi Makefile; remove -Wl,--no-undefined from:, make # libquicktimecv_la_LDFLAGS = -version-info 1:0:0 -release 1.6.0 diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 039e8400..f7aa770d 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -826,7 +826,8 @@ void AWindowRemovePlugin::handle_close_event(int result) mwindow->plugindb->remove(plugin); remove(plugin_path); char index_path[BCTEXTLEN]; - sprintf(index_path, "%s/%s", mwindow->preferences->plugin_dir, PLUGIN_FILE); + snprintf(index_path, sizeof(index_path), "%s/%s", + mwindow->preferences->plugin_dir, PLUGIN_FILE); remove(index_path); char png_path[BCTEXTLEN]; if( plugin->get_theme_png_path(png_path, mwindow->preferences->theme) ) diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index 14b978c1..3ed07e48 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -416,8 +416,8 @@ void CreateBD_Thread::handle_close_event(int result) } char asset_dir[BCTEXTLEN], jobs_path[BCTEXTLEN]; - sprintf(asset_dir, "%s/%s", tmp_path, asset_title); - sprintf(jobs_path, "%s/bd.jobs", asset_dir); + snprintf(asset_dir, sizeof(asset_dir), "%s/%s", tmp_path, asset_title); + snprintf(jobs_path, sizeof(jobs_path), "%s/bd.jobs", asset_dir); mwindow->batch_render->reset(jobs_path); int ret = create_bd_jobs(&mwindow->batch_render->jobs, asset_dir); mwindow->undo->update_undo_after(_("create bd"), LOAD_ALL); diff --git a/cinelerra-5.1/cinelerra/dcraw.C b/cinelerra-5.1/cinelerra/dcraw.C index 65d88056..188ae319 100644 --- a/cinelerra-5.1/cinelerra/dcraw.C +++ b/cinelerra-5.1/cinelerra/dcraw.C @@ -92,6 +92,14 @@ typedef uint64_t UINT64; #include "dcraw.h" +//const static data +const double DCRaw_data::xyz_rgb[3][3] = { /* XYZ from RGB */ + { 0.412453, 0.357580, 0.180423 }, + { 0.212671, 0.715160, 0.072169 }, + { 0.019334, 0.119193, 0.950227 } }; +const float DCRaw_data::d65_white[3] = { + 0.950456, 1.000000, 1.088754 }; + /* All global variables are defined here, and all functions that access them are prefixed with "CLASS". Note that a thread-safe @@ -3264,7 +3272,7 @@ short * CLASS foveon_make_curve (double max, double mul, double filt) if (!filt) filt = 0.8; size = 4*M_PI*max / filt; - if (size == UINT_MAX) size--; + if (size > INT_MAX-1) size = INT_MAX-1; curve = (short *) calloc (size+1, sizeof *curve); merror (curve, "foveon_make_curve()"); curve[0] = size; @@ -3298,19 +3306,34 @@ void CLASS foveon_interpolate() { static const short hood[] = { -1,-1, -1,0, -1,1, 0,-1, 0,1, 1,-1, 1,0, 1,1 }; short *pix, prev[3], *curve[8], (*shrink)[3]; - float cfilt=0, ddft[3][3][2], ppm[3][3][3]; + float cfilt, ddft[3][3][2], ppm[3][3][3]; float cam_xyz[3][3], correct[3][3], last[3][3], trans[3][3]; float chroma_dq[3], color_dq[3], diag[3][3], div[3]; float (*black)[3], (*sgain)[3], (*sgrow)[3]; float fsum[3], val, frow, num; int row, col, c, i, j, diff, sgx, irow, sum, min, max, limit; int dscr[2][2], dstb[4], (*smrow[7])[3], total[4], ipix[3]; - int work[3][3], smlast, smred, smred_p=0, dev[3]; + int work[3][3], smlast, smred, smred_p, dev[3]; int satlev[3], keep[4], active[4]; unsigned dim[3], *badpix; - double dsum=0, trsum[3]; + double dsum, trsum[3]; char str[128]; const char* cp; +// clear local storage + pix = 0; ZERO(prev); ZERO(curve); ZERO(shrink); + cfilt = 0; ZERO(ddft); ZERO(ppm); + ZERO(cam_xyz); ZERO(correct); ZERO(last); ZERO(trans); + ZERO(chroma_dq); ZERO(color_dq); ZERO(diag); ZERO(div); + ZERO(black); ZERO(sgain); ZERO(sgrow); + ZERO(fsum); val = frow = num = 0; + row = col = c = i = j = diff = sgx = irow = sum = min = max = limit = 0; + ZERO(dscr); ZERO(dstb); ZERO(smrow); ZERO(total); ZERO(ipix); + ZERO(work); ZERO(smlast); ZERO(smred); smred_p=0; ZERO(dev); + ZERO(satlev); ZERO(keep); ZERO(active); + ZERO(dim); badpix = 0; + dsum = 0; ZERO(trsum); + ZERO(str); + cp = 0; if (verbose) fprintf (stderr,_("Foveon interpolation...\n")); @@ -6017,7 +6040,7 @@ guess_cfa_pc: case 61450: cblack[4] = cblack[5] = MIN(sqrt(len),64); case 50714: /* BlackLevel */ - if (!(cblack[4] * cblack[5])) + if ((cblack[4] * cblack[5])==0) cblack[4] = cblack[5] = 1; FORC (cblack[4] * cblack[5]) cblack[6+c] = getreal(type); diff --git a/cinelerra-5.1/cinelerra/dcraw.h b/cinelerra-5.1/cinelerra/dcraw.h index c0f56779..0f04db36 100644 --- a/cinelerra-5.1/cinelerra/dcraw.h +++ b/cinelerra-5.1/cinelerra/dcraw.h @@ -87,6 +87,10 @@ public: unsigned fov_huff[1024]; float clb_cbrt[0x10000], clb_xyz_cam[3][4]; uchar pana_buf[0x4000]; int pana_vbits; +// const static data + static const double xyz_rgb[3][3]; + static const float d65_white[3]; + }; class DCRaw : public DCRaw_data { @@ -275,13 +279,6 @@ private: void write_ppm_tiff(void); void write_cinelerra(void); void reset(); -//const data - const double xyz_rgb[3][3] = { /* XYZ from RGB */ - { 0.412453, 0.357580, 0.180423 }, - { 0.212671, 0.715160, 0.072169 }, - { 0.019334, 0.119193, 0.950227 } }; - const float d65_white[3] = { 0.950456, 1, 1.088754 }; - public: DCRaw(); ~DCRaw(); diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C index 6a870a72..e7eb1db2 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.C +++ b/cinelerra-5.1/cinelerra/dvdcreate.C @@ -438,8 +438,8 @@ void CreateDVD_Thread::handle_close_event(int result) insert_video_plugin("Histogram", &keyframe); } char asset_dir[BCTEXTLEN], jobs_path[BCTEXTLEN]; - sprintf(asset_dir, "%s/%s", tmp_path, asset_title); - sprintf(jobs_path, "%s/dvd.jobs", asset_dir); + snprintf(asset_dir, sizeof(asset_dir), "%s/%s", tmp_path, asset_title); + snprintf(jobs_path, sizeof(jobs_path), "%s/dvd.jobs", asset_dir); mwindow->batch_render->reset(jobs_path); int ret = create_dvd_jobs(&mwindow->batch_render->jobs, asset_dir); mwindow->undo->update_undo_after(_("create dvd"), LOAD_ALL); diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C index 06982c95..7c8afaa2 100644 --- a/cinelerra-5.1/cinelerra/exportedl.C +++ b/cinelerra-5.1/cinelerra/exportedl.C @@ -365,8 +365,7 @@ ExportEDLWindow::~ExportEDLWindow() void ExportEDLWindow::create_objects() { int x = 5, y = 5; - add_subwindow(new BC_Title(x, - y, + add_subwindow(new BC_Title(x, y, _("Select a file to export to:"))); y += 25; @@ -399,7 +398,7 @@ void ExportEDLWindow::create_objects() track = track->next) { - char tmp[10]; + char tmp[16]; sprintf(tmp, "%i\n", serial+1); BC_ListBoxItem *listitem = new BC_ListBoxItem(tmp); diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index 70440b64..f79a240e 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -557,7 +557,7 @@ int FFStream::seek(int64_t no, double rate) } } if( ret < 0 ) { -printf("** seek fail %ld, %ld\n", pos, tstmp); +printf("** seek fail %jd, %jd\n", pos, tstmp); seeked = need_packet = 0; st_eof(flushed=1); return -1; diff --git a/cinelerra-5.1/cinelerra/filempeg.C b/cinelerra-5.1/cinelerra/filempeg.C index 8ddf44f1..0526875b 100644 --- a/cinelerra-5.1/cinelerra/filempeg.C +++ b/cinelerra-5.1/cinelerra/filempeg.C @@ -495,7 +495,8 @@ int FileMPEG::open_file(int rd, int wr) if(!result) { const char *exec_path = File::get_cinlib_path(); - sprintf(mjpeg_command, "%s/%s", exec_path, HVPEG_EXE); + snprintf(mjpeg_command, sizeof(mjpeg_command), + "%s/%s", exec_path, HVPEG_EXE); append_vcommand_line(mjpeg_command); if(asset->aspect_ratio > 0) @@ -545,7 +546,8 @@ int FileMPEG::open_file(int rd, int wr) // this one is cinelerra-x.x.x/thirdparty/mjpegtools/mpeg2enc { const char *exec_path = File::get_cinlib_path(); - sprintf(mjpeg_command, "%s/%s -v 0 ", exec_path, MJPEG_EXE); + snprintf(mjpeg_command, sizeof(mjpeg_command), + "%s/%s -v 0 ", exec_path, MJPEG_EXE); // Must disable interlacing if MPEG-1 switch (asset->vmpeg_preset) @@ -560,18 +562,15 @@ int FileMPEG::open_file(int rd, int wr) // quantization of 1 when bitrate is fixed. Perfectly intuitive. if(asset->vmpeg_fix_bitrate) { - sprintf(string, " -b %d -q 1", asset->vmpeg_bitrate / 1000); + snprintf(string, sizeof(string), + " -b %d -q 1", asset->vmpeg_bitrate / 1000); } else { - sprintf(string, " -b 0 -q %d", asset->vmpeg_quantization); + snprintf(string, sizeof(string), + " -b 0 -q %d", asset->vmpeg_quantization); } - strcat(mjpeg_command, string); - - - - - + strncat(mjpeg_command, string, sizeof(mjpeg_command)); // Aspect ratio int aspect_ratio_code = -1; @@ -599,7 +598,7 @@ int FileMPEG::open_file(int rd, int wr) aspect_ratio_code = 2; } sprintf(string, " -a %d", aspect_ratio_code); - strcat(mjpeg_command, string); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); @@ -623,43 +622,49 @@ int FileMPEG::open_file(int rd, int wr) eprintf(_("Unsupported frame rate %f\n"), asset->frame_rate); } sprintf(string, " -F %d", frame_rate_code); - strcat(mjpeg_command, string); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); - strcat(mjpeg_command, - asset->vmpeg_progressive ? " -I 0" : " -I 1"); + strncat(mjpeg_command, + asset->vmpeg_progressive ? " -I 0" : " -I 1", + sizeof(mjpeg_command)); sprintf(string, " -M %d", file->cpus); - strcat(mjpeg_command, string); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); if(!asset->vmpeg_progressive) { - strcat(mjpeg_command, asset->vmpeg_field_order ? " -z b" : " -z t"); + strncat(mjpeg_command, + asset->vmpeg_field_order ? " -z b" : " -z t", + sizeof(mjpeg_command)); } - sprintf(string, " -f %d", asset->vmpeg_preset); - strcat(mjpeg_command, string); + snprintf(string, sizeof(string), " -f %d", asset->vmpeg_preset); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); - sprintf(string, " -g %d -G %d", asset->vmpeg_iframe_distance, asset->vmpeg_iframe_distance); - strcat(mjpeg_command, string); + snprintf(string, sizeof(string), + " -g %d -G %d", asset->vmpeg_iframe_distance, asset->vmpeg_iframe_distance); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); - if(asset->vmpeg_seq_codes) strcat(mjpeg_command, " -s"); + if(asset->vmpeg_seq_codes) + strncat(mjpeg_command, " -s", sizeof(mjpeg_command)); - sprintf(string, " -R %d", CLAMP(asset->vmpeg_pframe_distance, 0, 2)); - strcat(mjpeg_command, string); + snprintf(string, sizeof(string), + " -R %d", CLAMP(asset->vmpeg_pframe_distance, 0, 2)); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); - sprintf(string, " -o '%s'", asset->path); - strcat(mjpeg_command, string); + snprintf(string, sizeof(string), " -o '%s'", asset->path); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); diff --git a/cinelerra-5.1/cinelerra/fileogg.C b/cinelerra-5.1/cinelerra/fileogg.C index 4f24a88e..0c718fba 100644 --- a/cinelerra-5.1/cinelerra/fileogg.C +++ b/cinelerra-5.1/cinelerra/fileogg.C @@ -2379,7 +2379,9 @@ int PackagingEngineOGG::create_packages_single_farm( if (default_asset->audio_data) { packages[local_current_package] = new RenderPackage; - sprintf(packages[current_package]->path, "%s.audio", default_asset->path); + snprintf(packages[current_package]->path, + sizeof(packages[current_package]->path), + "%s.audio", default_asset->path); local_current_package++; } diff --git a/cinelerra-5.1/cinelerra/packagerenderer.C b/cinelerra-5.1/cinelerra/packagerenderer.C index d4341493..178082a4 100644 --- a/cinelerra-5.1/cinelerra/packagerenderer.C +++ b/cinelerra-5.1/cinelerra/packagerenderer.C @@ -152,9 +152,10 @@ void PackageRenderer::create_output() asset = new Asset(*default_asset); if(!get_master() && preferences->renderfarm_vfs && preferences->use_renderfarm) - sprintf(asset->path, RENDERFARM_FS_PREFIX "%s", package->path); + snprintf(asset->path, sizeof(asset->path), + RENDERFARM_FS_PREFIX "%s", package->path); else - strcpy(asset->path, package->path); + strncpy(asset->path, package->path, sizeof(asset->path)); file = new File; @@ -171,7 +172,7 @@ void PackageRenderer::create_output() { // open failed char string[BCTEXTLEN]; - sprintf(string, _("Couldn't open %s"), asset->path); + snprintf(string, sizeof(string), _("Couldn't open %s"), asset->path); ErrorBox error(_(PROGRAM_NAME ": Error"), mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1)); diff --git a/cinelerra-5.1/cinelerra/plugindialog.C b/cinelerra-5.1/cinelerra/plugindialog.C index b1091c8b..172eaf91 100644 --- a/cinelerra-5.1/cinelerra/plugindialog.C +++ b/cinelerra-5.1/cinelerra/plugindialog.C @@ -292,7 +292,7 @@ void PluginDialog::create_objects() char *plugin_title = plugin->title; char string[BCTEXTLEN]; - sprintf(string, "%s: %s", track_title, _(plugin_title)); + snprintf(string, sizeof(string), "%s: %s", track_title, _(plugin_title)); shared_data.append(new BC_ListBoxItem(string)); } for(int i = 0; i < module_locations.total; i++) diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index d6607933..48f55f28 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -597,7 +597,6 @@ for dep in \ libtheora/libogg libtheora/libvorbis ; do lib=`dirname $dep`; needs=`basename $dep` eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs"; - echo "dep lib=$lib, needs=$needs, pkg_lib=$pkg_lib, needs_lib=$needs_lib" > /dev/tty if test "x$pkg_lib" != "xno"; then eval "PKG_$needs=yes" fi @@ -643,9 +642,7 @@ PKG_PROVIDE([libtheora]) PKG_PROVIDE([libuuid]) PKG_PROVIDE([libvorbis]) PKG_PROVIDE([mjpegtools]) -echo "WANT_OPENEXR = $WANT_OPENEXR" > /dev/tty PKG_PROVIDE([openexr], [$WANT_OPENEXR]) -echo "PKG_openexr = $PKG_openexr" > /dev/tty PKG_PROVIDE([openjpeg]) PKG_PROVIDE([tiff]) PKG_PROVIDE([twolame]) diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C index 50c38a1c..86544cc6 100644 --- a/cinelerra-5.1/guicast/filesystem.C +++ b/cinelerra-5.1/guicast/filesystem.C @@ -643,18 +643,14 @@ int FileSystem::parse_directories(char *new_dir) strcpy(string, new_dir); } else - if(!is_root_dir(current_dir)) { -// current directory is not root - if(current_dir[strlen(current_dir) - 1] == '/') -// current_dir already has ending / - sprintf(string, "%s%s", current_dir, new_dir); - else -// need ending / - sprintf(string, "%s/%s", current_dir, new_dir); + snprintf(string, sizeof(string), + is_root_dir(current_dir) || + current_dir[strlen(current_dir)-1] == '/' ? +// current directory is root or already has ending / + "%s%s" : "%s/%s", + current_dir, new_dir); } - else - sprintf(string, "%s%s", current_dir, new_dir); //printf("FileSystem::parse_directories 3 %s %s\n", new_dir, string); strcpy(new_dir, string); diff --git a/cinelerra-5.1/libzmpeg3/libzmpeg3.h b/cinelerra-5.1/libzmpeg3/libzmpeg3.h index 6fc2c6c7..712d1ca0 100644 --- a/cinelerra-5.1/libzmpeg3/libzmpeg3.h +++ b/cinelerra-5.1/libzmpeg3/libzmpeg3.h @@ -2846,9 +2846,9 @@ public: } static inline void complete_path(char *full_path, char *path) { - char dir[zmpeg3_t::STRLEN]; + char dir[STRLEN]; if( path[0] != '/' && getcwd(dir, sizeof(dir)) ) - sprintf(full_path, "%s/%s", dir, path); + snprintf(full_path, STRLEN, "%s/%s", dir, path); else strcpy(full_path, path); } @@ -2875,7 +2875,7 @@ public: } static inline void joinpath(char *path, char *dir, char *filename) { - sprintf(path, "%s/%s", dir, filename); + snprintf(path, STRLEN, "%s/%s", dir, filename); } static inline int64_t path_total_bytes(char *path) { diff --git a/cinelerra-5.1/plugins/motion-cv/motion-cv.C b/cinelerra-5.1/plugins/motion-cv/motion-cv.C index 2359e0e2..b434e42a 100644 --- a/cinelerra-5.1/plugins/motion-cv/motion-cv.C +++ b/cinelerra-5.1/plugins/motion-cv/motion-cv.C @@ -652,7 +652,7 @@ printf("MotionCVMain::process_buffer 1 start_position=%jd\n", start_position); config.mode2 == MotionCVConfig::SAVE ) { reset_cache_file(); char save_file[BCTEXTLEN]; - sprintf(save_file, "%s.sav", config.tracking_file); + snprintf(save_file, sizeof(save_file), "%s.sav", config.tracking_file); #ifdef DEBUG printf("MotionCVMain::process_buffer 2 rename tracking file: %s to %s\n", config.tracking_file, save_file); @@ -1320,7 +1320,7 @@ int MotionCVMain::put_cache_line(const char *line) if( key == active_key ) return 1; if( !active_fp ) { close_cache_file(); - sprintf(cache_file, "%s.bak", config.tracking_file); + snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file); ::rename(config.tracking_file, cache_file); if( !(active_fp = fopen(config.tracking_file, "w")) ) { perror(config.tracking_file); diff --git a/cinelerra-5.1/plugins/motion/motion.C b/cinelerra-5.1/plugins/motion/motion.C index b1eb5b8e..db9235ec 100644 --- a/cinelerra-5.1/plugins/motion/motion.C +++ b/cinelerra-5.1/plugins/motion/motion.C @@ -701,7 +701,7 @@ printf("MotionMain::process_buffer %d start_position=%jd\n", __LINE__, start_pos config.tracking_type == MotionScan::SAVE ) { reset_cache_file(); char save_file[BCTEXTLEN]; - sprintf(save_file,"%s.bak", config.tracking_file); + snprintf(save_file, sizeof(save_file), "%s.bak", config.tracking_file); #ifdef DEBUG printf("MotionMain::process_buffer 2 rename tracking file: %s to %s\n", config.tracking_file, save_file); @@ -1181,7 +1181,7 @@ int MotionMain::put_cache_line(const char *line) if( key == active_key ) return 1; if( !active_fp ) { close_cache_file(); - sprintf(cache_file, "%s.bak", config.tracking_file); + snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file); ::rename(config.tracking_file, cache_file); if( !(active_fp = fopen(config.tracking_file, "w")) ) { perror(config.tracking_file); diff --git a/cinelerra-5.1/plugins/motion51/motion51.C b/cinelerra-5.1/plugins/motion51/motion51.C index 402a5a00..483c6e5f 100644 --- a/cinelerra-5.1/plugins/motion51/motion51.C +++ b/cinelerra-5.1/plugins/motion51/motion51.C @@ -686,7 +686,7 @@ int Motion51Main::put_cache_line(const char *line) if( key == active_key ) return 1; if( !active_fp ) { close_cache_file(); - sprintf(cache_file, "%s.bak", config.tracking_file); + snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file); ::rename(config.tracking_file, cache_file); if( !(active_fp = fopen(config.tracking_file, "w")) ) { perror(config.tracking_file); diff --git a/cinelerra-5.1/plugins/svg/svg.C b/cinelerra-5.1/plugins/svg/svg.C index 842161ae..af4a79d4 100644 --- a/cinelerra-5.1/plugins/svg/svg.C +++ b/cinelerra-5.1/plugins/svg/svg.C @@ -178,7 +178,7 @@ int SvgMain::process_realtime(VFrame *input, VFrame *output) int fd = ms_time < config.ms_time ? -1 : open(filename_png, O_RDWR); if( fd < 0 ) { // file does not exist, export it char command[BCTEXTLEN]; - sprintf(command, + snprintf(command, sizeof(command), "inkscape --without-gui --export-background=0x000000 " "--export-background-opacity=0 -d %f %s --export-png=%s", config.dpi, config.svg_file, filename_png); diff --git a/cinelerra-5.1/plugins/svg/svgwin.C b/cinelerra-5.1/plugins/svg/svgwin.C index 3269c61f..9931a8dd 100644 --- a/cinelerra-5.1/plugins/svg/svgwin.C +++ b/cinelerra-5.1/plugins/svg/svgwin.C @@ -358,7 +358,8 @@ void SvgInkscapeThread::run() { // Runs the inkscape char command[1024]; - sprintf(command, "inkscape --with-gui %s", edit->client->config.svg_file); + snprintf(command, sizeof(command), + "inkscape --with-gui %s", edit->client->config.svg_file); printf(_("Running external SVG editor: %s\n"), command); enable_cancel(); diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index 9adf4e26..74a4aadf 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -1423,7 +1423,7 @@ int TitleCurPopup::handle_event() return 1; } -void TitleCurSubMenu::add_subitem(int popup_type, va_list ap, const char *fmt) +void TitleCurSubMenu::add_subitemx(int popup_type, va_list ap, const char *fmt) { char item[BCSTRLEN]; vsnprintf(item, sizeof(item)-1, fmt, ap); diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.h b/cinelerra-5.1/plugins/titler/titlerwindow.h index 1f968301..96086c5e 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.h +++ b/cinelerra-5.1/plugins/titler/titlerwindow.h @@ -551,12 +551,12 @@ class TitleCurSubMenu : public BC_SubMenu public: TitleCurSubMenu(TitleCurItem *cur_item); ~TitleCurSubMenu(); - void add_subitem(int popup_type, va_list ap, const char *fmt); + void add_subitemx(int popup_type, va_list ap, const char *fmt); void add_subitem(int popup_type, const char *fmt,...) { va_list ap; - va_start(ap, fmt); add_subitem(popup_type, ap, fmt); va_end(ap); + va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap); } void add_subitem(const char *fmt,...) { va_list ap; - va_start(ap, fmt); add_subitem(POPUP_NONE, ap, fmt); va_end(ap); + va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap); } TitleCurItem *cur_item; };