aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-05 17:15:38 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-06 02:08:26 +0100
commit9ce8308ee3641f2cfc95a9fa7963b21f24f24302 (patch)
treeb0f299c5285cfe9344c64e524c5ff00ea0dfeb93
parent87dbcf7cd28e4c3b2e17c653b580f19c8566b0ec (diff)
downloadffmpeg-9ce8308ee3641f2cfc95a9fa7963b21f24f24302.tar.gz
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 a08681f1e614152184615e2bcd71c3d63835f810) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/dirac_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dirac_parser.c b/libavcodec/dirac_parser.c
index c7c4b697c8..1ca7e31f1c 100644
--- a/libavcodec/dirac_parser.c
+++ b/libavcodec/dirac_parser.c
@@ -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);