Browse Source

avcodec/dirac_parser: Check that there is a previous PU before accessing it

Fixes out of array read
Fixes: 99d142c47e6ba3510a74b872a1a2ae72/asan_heap-oob_11b36f4_3811_0f5c69e7609a88a580135678de1df844.dxa

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a08681f1e6)

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

+ 1
- 1
libavcodec/dirac_parser.c View File

@@ -201,7 +201,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
}

/* Get the picture number to set the pts and dts*/
if (parse_timing_info) {
if (parse_timing_info && pu1.prev_pu_offset >= 13) {
uint8_t *cur_pu = pc->buffer +
pc->index - 13 - pu1.prev_pu_offset;
int pts = AV_RB32(cur_pu + 13);


Loading…
Cancel
Save