changeset 35240:db0feadeac0a

Avoid potential overflow in shift.
author reimar
date Thu, 01 Nov 2012 22:23:07 +0000
parents f8759138eefa
children 3ca6a7d60396
files libmpdemux/demux_ogg.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c	Thu Nov 01 22:22:04 2012 +0000
+++ b/libmpdemux/demux_ogg.c	Thu Nov 01 22:23:07 2012 +0000
@@ -298,7 +298,7 @@
            have theora_state st, until all header packets were passed to the
            decoder. */
         if (!pack->bytes || !(*data&0x80)) {
-            int64_t iframemask = (1 << os->keyframe_granule_shift) - 1;
+            int64_t iframemask = (1ull << os->keyframe_granule_shift) - 1;
 
             if (pack->granulepos >= 0) {
                 os->lastpos  = pack->granulepos >> os->keyframe_granule_shift;