Browse Source

avcodec/dirac_parser: Fix potential overflows in pointer checks

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 79798f7c57)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.4.12
Michael Niedermayer 10 years ago
parent
commit
142f8308a1
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      libavcodec/dirac_parser.c

+ 5
- 3
libavcodec/dirac_parser.c View File

@@ -100,10 +100,12 @@ typedef struct DiracParseUnit {
static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
int offset)
{
uint8_t *start = pc->buffer + offset;
uint8_t *end = pc->buffer + pc->index;
if (start < pc->buffer || (start + 13 > end))
int8_t *start;
if (offset < 0 || pc->index - 13 < offset)
return 0;

start = pc->buffer + offset;
pu->pu_type = start[4];

pu->next_pu_offset = AV_RB32(start + 5);


Loading…
Cancel
Save