- if(asset->frame_rate == 0)
- asset->frame_rate = atof(string);
-
- do
- {
- (void)fgets(string, BCTEXTLEN, stream);
- }while(!feof(stream) && (string[0] == '#' || string[0] == ' '));
- asset->width = atol(string);
-
- do
- {
- (void)fgets(string, BCTEXTLEN, stream);
- }while(!feof(stream) && (string[0] == '#' || string[0] == ' '));
- asset->height = atol(string);
-
- asset->interlace_mode = ILACE_MODE_UNDETECTED; // May be good to store the info in the list?
- asset->layers = 1;
- asset->audio_data = 0;
- asset->video_data = 1;
+ if(asset->frame_rate == 0)
+ asset->frame_rate = atof(string);
+
+ do {
+ if( feof(stream) || !fgets(string, BCTEXTLEN, stream) ) return 1;
+ } while(string[0] == '#' || string[0] == ' ');
+ if( (asset->width = atol(string)) <= 0 ) return 1;
+
+ do {
+ if( feof(stream) || !fgets(string, BCTEXTLEN, stream) ) return 1;
+ } while(string[0] == '#' || string[0] == ' ');
+ if( (asset->height = atol(string)) <= 0 ) return 1;
+
+ asset->interlace_mode = ILACE_MODE_UNDETECTED;
+ asset->layers = 1;
+ asset->audio_data = 0;
+ asset->video_data = 1;