File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -245,17 +245,24 @@ const char *video_desc_to_string(struct video_desc d)
245245 return desc_str.c_str ();
246246}
247247
248+ /* *
249+ * @retval 0.0 FPS not specified
250+ * @retval <0.0 wrong FPS specification
251+ */
248252static double
249253parse_fps (const char *string, bool interlaced)
250254{
251255 const char *fps_str = strpbrk (string, " DKdikp" );
252256 assert (fps_str != nullptr );
253257 fps_str += 1 ;
258+ if (strlen (fps_str) == 0 ) {
259+ return 0.0 ;
260+ }
254261 char *endptr = nullptr ;
255262 const long fps_l = strtol (fps_str, &endptr, 10 );
256263 if (fps_l <= 0 || fps_l > FPS_MAX || *endptr != ' \0 ' ) {
257- MSG (ERROR, " Wrong mode specification: %s\n " , string);
258- return 0.0 ;
264+ MSG (ERROR, " Wrong mode FPS specification: %s\n " , string);
265+ return - 1 ;
259266 }
260267 double fps = 0 ;
261268 // adjust FPS (Hi29 has FPS 29.97)
@@ -355,7 +362,7 @@ struct video_desc get_video_desc_from_string(const char *string)
355362 return {};
356363 }
357364 ret.fps = parse_fps (string, ret.interlacing == INTERLACED_MERGED);
358- if (ret.fps == 0 .0 ) {
365+ if (ret.fps < .0 ) {
359366 return {};
360367 }
361368
You can’t perform that action at this time.
0 commit comments