Browse Source

avformat/oggdec: Fix integer overflow with invalid pts

If negative pts are possible for some codecs in ogg then the code needs to be
changed to use signed values.

Found-by: Thomas Guilbert <tguilbert@google.com>
Fixes: clusterfuzz_usan-2016-08-02
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c5cc3b08e5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.8.8
Michael Niedermayer 9 years ago
parent
commit
942c3bfbdf
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/oggdec.h

+ 5
- 0
libavformat/oggdec.h View File

@@ -161,6 +161,11 @@ ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts)
if (dts)
*dts = pts;
}
if (pts > INT64_MAX && pts != AV_NOPTS_VALUE) {
// The return type is unsigned, we thus cannot return negative pts
av_log(s, AV_LOG_ERROR, "invalid pts %"PRId64"\n", pts);
pts = AV_NOPTS_VALUE;
}

return pts;
}


Loading…
Cancel
Save