1 goto 1 fix
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 6 Feb 2006 11:21:26 +0000 (11:21 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 6 Feb 2006 11:21:26 +0000 (11:21 +0000)
Originally committed as revision 4946 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegvideo.c

index ba641f30a3c90e9d4237a12d2fe37debe69113db..a7ae07b412dcf8a4693facb610a860b383cf6950 100644 (file)
@@ -231,6 +231,10 @@ void ff_write_quant_matrix(PutBitContext *pb, int16_t *matrix){
 const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){
     int i;
 
+    assert(p<=end);
+    if(p>=end)
+        return end;
+
     for(i=0; i<3; i++){
         uint32_t tmp= *state << 8;
         *state= tmp + *(p++);