Commit dc6f1a8d authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/srtdec: Fix pointer corruption

This fixes use of uninitialized memory and possible out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6b13f542
......@@ -63,10 +63,12 @@ static int64_t get_pts(const char **buf, int *duration,
int64_t start = (hh1*3600LL + mm1*60LL + ss1) * 1000LL + ms1;
int64_t end = (hh2*3600LL + mm2*60LL + ss2) * 1000LL + ms2;
*duration = end - start;
*buf += strcspn(*buf, "\n") + 1;
*buf += strcspn(*buf, "\n");
*buf += !!**buf;
return start;
}
*buf += strcspn(*buf, "\n") + 1;
*buf += strcspn(*buf, "\n");
*buf += !!**buf;
}
return AV_NOPTS_VALUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment