This fixes a crash where aspect ratio "0.5" from harvid was interpreted
as "0" in the French locale (expecting 0,5).
Note: harvid uses a portable, not localized snprintf() implementation
double &video_aspect_ratio
)
{
+ LocaleGuard lg;
char url[2048];
snprintf(url, sizeof(url), "%s%sinfo/?file=%s&format=csv"
video_aspect_ratio = atof (lines.at(0).at(3));
video_file_fps = atof (lines.at(0).at(4));
video_duration = atoll(lines.at(0).at(5));
+
+ if (video_aspect_ratio < 0.01 || video_file_fps < 0.01) {
+ /* catch errors early, aspect == 0 or fps == 0 will
+ * wreak havoc down the road */
+ return false;
+ }
return true;
}