paf: avoid C99 overflows
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Oct 2012 02:01:41 +0000 (04:01 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Oct 2012 02:01:41 +0000 (04:01 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/paf.c

index 8fe2ac5..e67732b 100644 (file)
@@ -212,8 +212,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
         if (p->current_frame_block >= p->frame_blks)
             return AVERROR_INVALIDDATA;
 
-        offset = p->blocks_offset_table[p->current_frame_block] & ~(1 << 31);
-        if (p->blocks_offset_table[p->current_frame_block] & (1 << 31)) {
+        offset = p->blocks_offset_table[p->current_frame_block] & ~(1U << 31);
+        if (p->blocks_offset_table[p->current_frame_block] & (1U << 31)) {
             if (offset > p->audio_size - p->buffer_size)
                 return AVERROR_INVALIDDATA;