Mercurial > libavcodec.hg
comparison xan.c @ 9497:cb387dff812d libavcodec
Change buffer check to avoid an unlikely pointer arithmetic overflow.
author | reimar |
---|---|
date | Fri, 17 Apr 2009 19:49:55 +0000 |
parents | 2c6a58787aeb |
children | 6abd94fdd827 |
comparison
equal
deleted
inserted
replaced
9496:2c6a58787aeb | 9497:cb387dff812d |
---|---|
102 | 102 |
103 while ( val != 0x16 ) { | 103 while ( val != 0x16 ) { |
104 val = src[val - 0x17 + get_bits1(&gb) * byte]; | 104 val = src[val - 0x17 + get_bits1(&gb) * byte]; |
105 | 105 |
106 if ( val < 0x16 ) { | 106 if ( val < 0x16 ) { |
107 if (dest + 1 > dest_end) | 107 if (dest >= dest_end) |
108 return 0; | 108 return 0; |
109 *dest++ = val; | 109 *dest++ = val; |
110 val = ival; | 110 val = ival; |
111 } | 111 } |
112 } | 112 } |