mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-18 21:10:10 +01:00
avformat/mccdec: Initialize and check rate.den
Fixes: Assertion c > 0 failed at libavutil/mathematics.c:61 Fixes: use-of-uninitialized-value Fixes: 42537627/clusterfuzz-testcase-minimized-fuzzer_protocol_memory-5939605805793280 Found-by: ossfuzz Reported-by: Kacper Michajlow Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -93,7 +93,7 @@ static int mcc_read_header(AVFormatContext *s)
|
|||||||
{
|
{
|
||||||
MCCContext *mcc = s->priv_data;
|
MCCContext *mcc = s->priv_data;
|
||||||
AVStream *st = avformat_new_stream(s, NULL);
|
AVStream *st = avformat_new_stream(s, NULL);
|
||||||
AVRational rate;
|
AVRational rate = {0};
|
||||||
int64_t ts, pos;
|
int64_t ts, pos;
|
||||||
uint8_t out[4096];
|
uint8_t out[4096];
|
||||||
char line[4096];
|
char line[4096];
|
||||||
@@ -139,7 +139,7 @@ static int mcc_read_header(AVFormatContext *s)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (av_sscanf(line, "%d:%d:%d:%d", &hh, &mm, &ss, &fs) != 4)
|
if (av_sscanf(line, "%d:%d:%d:%d", &hh, &mm, &ss, &fs) != 4 || rate.den <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ts = av_sat_add64(av_rescale(hh * 3600LL + mm * 60LL + ss, rate.num, rate.den), fs);
|
ts = av_sat_add64(av_rescale(hh * 3600LL + mm * 60LL + ss, rate.num, rate.den), fs);
|
||||||
|
|||||||
Reference in New Issue
Block a user