Skip to content

Commit

Permalink
MetadataDateTime: Fix crash in fallback scanf code (#785)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Wootten <[email protected]>
  • Loading branch information
jeremypw and Jeremy Wootten authored Nov 25, 2024
1 parent 059e80a commit 725ff6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MediaMetadata.vala
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ public class MetadataDateTime {
int second = 0;

if (date_time_s.scanf ("%d:%d:%d %d:%d:%d",
&year, &month, &day, &hour, &minute, &second) != 6) {
out year, out month, out day, out hour, out minute, out second) != 6) {
// Fallback in a more generic format
string tmp = date_time_s.dup ();
tmp.canon ("0123456789", ' ');
if (tmp.scanf ("%4d%2d%2d%2d%2d%2d",
year, month, day, hour, minute, second) != 6) {
out year, out month, out day, out hour, out minute, out second) != 6) {
return false;
}
}
Expand Down

0 comments on commit 725ff6e

Please sign in to comment.