mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/dvbsub_parser: Fix potential pointer overflows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
84da9339c2
commit
de41d5372f
|
@ -122,11 +122,11 @@ static int dvbsub_parse(AVCodecParserContext *s,
|
||||||
{
|
{
|
||||||
if (*p == 0x0f)
|
if (*p == 0x0f)
|
||||||
{
|
{
|
||||||
if (p + 6 <= p_end)
|
if (6 <= p_end - p)
|
||||||
{
|
{
|
||||||
len = AV_RB16(p + 4);
|
len = AV_RB16(p + 4);
|
||||||
|
|
||||||
if (p + len + 6 <= p_end)
|
if (len + 6 <= p_end - p)
|
||||||
{
|
{
|
||||||
*poutbuf_size += len + 6;
|
*poutbuf_size += len + 6;
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
} else if (*p == 0xff) {
|
} else if (*p == 0xff) {
|
||||||
if (p + 1 < p_end)
|
if (1 < p_end - p)
|
||||||
{
|
{
|
||||||
av_dlog(avctx, "Junk at end of packet\n");
|
av_dlog(avctx, "Junk at end of packet\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue