changeset 1396:e380ac39024a libavcodec

cleanup / fixes
author michaelni
date Tue, 05 Aug 2003 10:19:43 +0000
parents b2ac20ff1458
children 2e43c9bdc982
files h263.c mpegvideo.c utils.c
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Sat Aug 02 22:01:02 2003 +0000
+++ b/h263.c	Tue Aug 05 10:19:43 2003 +0000
@@ -4832,13 +4832,13 @@
 
     check_marker(gb, "before time_increment");
     
-    if(s->picture_number==0 && (show_bits(gb, s->time_increment_bits+1)&1)==0){
+    if(s->time_increment_bits==0){
         printf("hmm, seems the headers arnt complete, trying to guess time_increment_bits\n");
-        
 
         for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){
             if(show_bits(gb, s->time_increment_bits+1)&1) break;
         }
+
         printf("my guess is %d bits ;)\n",s->time_increment_bits);
     }
     
@@ -5070,7 +5070,8 @@
 
         switch(startcode){
         case 0x120:
-            decode_vol_header(s, gb);
+            if(decode_vol_header(s, gb) < 0) 
+                return -1;
             break;
         case USER_DATA_STARTCODE:
             decode_user_data(s, gb);
--- a/mpegvideo.c	Sat Aug 02 22:01:02 2003 +0000
+++ b/mpegvideo.c	Tue Aug 05 10:19:43 2003 +0000
@@ -951,7 +951,7 @@
     assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3);
 
     /* mark&release old frames */
-    if (s->pict_type != B_TYPE && s->last_picture_ptr) {
+    if (s->pict_type != B_TYPE && s->last_picture_ptr && s->last_picture_ptr->data[0]) {
         avctx->release_buffer(avctx, (AVFrame*)s->last_picture_ptr);
 
         /* release forgotten pictures */
--- a/utils.c	Sat Aug 02 22:01:02 2003 +0000
+++ b/utils.c	Tue Aug 05 10:19:43 2003 +0000
@@ -220,6 +220,7 @@
     InternalBuffer *buf, *last, temp;
 
     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
+    assert(s->internal_buffer_count);
 
     for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
         buf= &((InternalBuffer*)s->internal_buffer)[i];