changeset 2634:95cfd6b8f8d5 libavformat

add some error processing
author aurel
date Thu, 18 Oct 2007 22:32:26 +0000
parents 0605d25fba46
children 9513cc77beb0
files electronicarts.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/electronicarts.c	Thu Oct 18 22:27:27 2007 +0000
+++ b/electronicarts.c	Thu Oct 18 22:32:26 2007 +0000
@@ -166,6 +166,7 @@
 
     for (i=0; i<5 && (!ea->audio_codec || !ea->video_codec); i++) {
         unsigned int startpos = url_ftell(pb);
+        int err = 0;
 
         blockid = get_le32(pb);
         size = get_le32(pb);
@@ -179,14 +180,19 @@
                     av_log (s, AV_LOG_ERROR, "unknown SCHl headerid\n");
                     return 0;
                 }
-                process_audio_header_elements(s);
+                err = process_audio_header_elements(s);
                 break;
 
             case MVhd_TAG :
-                process_video_header_vp6(s);
+                err = process_video_header_vp6(s);
                 break;
         }
 
+        if (err < 0) {
+            av_log(s, AV_LOG_ERROR, "error parsing header: %i\n", err);
+            return err;
+        }
+
         url_fseek(pb, startpos + size, SEEK_SET);
     }