avformat/matroskadec: fix integer overflow
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 19 May 2013 21:38:01 +0000 (23:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 19 May 2013 21:38:01 +0000 (23:38 +0200)
Fixes fate-mkv with ekopath 4

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/matroskadec.c

index 648941e..fc3e4f0 100644 (file)
@@ -2284,7 +2284,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
         return res;
     av_assert1(block_duration != AV_NOPTS_VALUE);
 
-    block_time = AV_RB16(data);
+    block_time = sign_extend(AV_RB16(data), 16);
     data += 2;
     flags = *data++;
     size -= 3;