Changeset 30

Show
Ignore:
Timestamp:
01/26/08 19:49:56 (8 months ago)
Author:
sip
Message:

More checks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • media/src/h263/h263codec.cpp

    r17 r30  
    304304        //Decodificamos  
    305305        int got_picture=0; 
     306        int readed = 0; 
     307 
     308        // Check total length 
     309        if (bufLen+inLen+FF_INPUT_BUFFER_PADDING_SIZE+2>bufSize) 
     310        { 
     311                // Reset buffer 
     312                bufLen = 0; 
     313 
     314                // Exit 
     315                return 0; 
     316        } 
    306317 
    307318        /* Get header */ 
     
    346357 
    347358                //Decodificamos 
    348                 avcodec_decode_video(ctx,picture,&got_picture,buffer,bufLen); 
     359                readed = avcodec_decode_video(ctx,picture,&got_picture,buffer,bufLen); 
    349360 
    350361                //Y resetamos el buffer 
     
    353364 
    354365        //Si hay picture 
    355         if (got_picture
     366        if (got_picture && readed>0
    356367        { 
    357368                if(ctx->width==0 || ctx->height==0) 
  • media/src/videostream.cpp

    r17 r30  
    666666                        } 
    667667 
    668                         //Lo sacamos 
    669                         videoOutput->NextFrame(videoDecoder->GetFrame()); 
     668                        //Check size 
     669                        if (width && height) 
     670                                //Lo sacamos 
     671                                videoOutput->NextFrame(videoDecoder->GetFrame()); 
    670672                         
    671673                        //Aumentamos el numero de frames y de bytes 
Copyright 2006 - Sergio García Murillo
Powered by Trac - Edgewall Software