mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:21:11 +01:00
avformat/jacosubdec: Check timeres
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
32447b149f
commit
51f0ab8b12
1 changed files with 7 additions and 4 deletions
|
|
@ -227,15 +227,18 @@ static int jacosub_read_header(AVFormatContext *s)
|
||||||
}
|
}
|
||||||
av_bprintf(&header, "#S %s", p);
|
av_bprintf(&header, "#S %s", p);
|
||||||
break;
|
break;
|
||||||
case 'T': // ...but must be placed after TIMERES
|
case 'T': { // ...but must be placed after TIMERES
|
||||||
jacosub->timeres = strtol(p, NULL, 10);
|
int64_t timeres = strtol(p, NULL, 10);
|
||||||
if (!jacosub->timeres)
|
if (timeres <= 0 || timeres > UINT32_MAX) {
|
||||||
jacosub->timeres = 30;
|
jacosub->timeres = 30;
|
||||||
else
|
} else {
|
||||||
|
jacosub->timeres = timeres;
|
||||||
av_bprintf(&header, "#T %s", p);
|
av_bprintf(&header, "#T %s", p);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* general/essential directives in the extradata */
|
/* general/essential directives in the extradata */
|
||||||
ret = ff_bprint_to_codecpar_extradata(st->codecpar, &header);
|
ret = ff_bprint_to_codecpar_extradata(st->codecpar, &header);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue