Skip to content
Snippets Groups Projects
Commit de41d537 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/dvbsub_parser: Fix potential pointer overflows

parent 84da9339
Branches
Tags
No related merge requests found
......@@ -122,11 +122,11 @@ static int dvbsub_parse(AVCodecParserContext *s,
{
if (*p == 0x0f)
{
if (p + 6 <= p_end)
if (6 <= p_end - p)
{
len = AV_RB16(p + 4);
if (p + len + 6 <= p_end)
if (len + 6 <= p_end - p)
{
*poutbuf_size += len + 6;
......@@ -136,7 +136,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
} else
break;
} else if (*p == 0xff) {
if (p + 1 < p_end)
if (1 < p_end - p)
{
av_dlog(avctx, "Junk at end of packet\n");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment