[vlc-commits] araw: add assertion

Rémi Denis-Courmont git at videolan.org
Mon Nov 17 18:03:26 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 17 17:56:16 2014 +0200| [60af6f144aa73c05b75acce1299b4be9ca5dfad4] | committer: Rémi Denis-Courmont

araw: add assertion

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60af6f144aa73c05b75acce1299b4be9ca5dfad4
---

 modules/codec/araw.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index a4b0f11..0746a5e 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -583,7 +583,7 @@ static void F64IDecode( void *outp, const uint8_t *in, unsigned samples )
     }
 }
 
-static int16_t dat12tos16( uint16_t y )
+static int16_t dat12tos16( uint_fast16_t y )
 {
     static const uint16_t diff[16] = {
        0x0000, 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600,
@@ -591,6 +591,8 @@ static int16_t dat12tos16( uint16_t y )
     static const uint8_t shift[16] = {
         0, 0, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1, 0, 0 };
 
+    assert(y < 0x1000);
+
     int d = y >> 8;
     return (y - diff[d]) << shift[d];
 }



More information about the vlc-commits mailing list