~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/avi/intern/avi.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * This is external code.
5
5
 *
6
 
 * $Id: avi.c,v 1.3 2002/11/25 12:01:51 mein Exp $ 
 
6
 * $Id: avi.c,v 1.4 2005/03/23 18:33:52 sirdude Exp $ 
7
7
 *
8
8
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
9
9
 *
46
46
 
47
47
#include "endian.h"
48
48
 
49
 
#ifdef HAVE_CONFIG_H
50
 
#include <config.h>
51
 
#endif
52
 
 
53
49
static int AVI_DEBUG=0;
54
50
static char DEBUG_FCC[4];
55
51
 
215
211
}
216
212
 
217
213
AviError AVI_open_movie (char *name, AviMovie *movie) {
218
 
        int temp, fcca, size;
 
214
        int temp, fcca, size, j;
219
215
        
220
216
        DEBUG("opening movie\n");
221
217
 
326
322
 
327
323
                movie->streams[temp].sf_size= GET_FCC(movie->fp);
328
324
                if (movie->streams[temp].sh.Type == FCC("vids")) {
329
 
                        if (movie->streams[temp].sf_size == sizeof(AviBitmapInfoHeader)-8) {
 
325
                        j = movie->streams[temp].sf_size - (sizeof(AviBitmapInfoHeader) - 8);
 
326
                        if (j >= 0) {
330
327
                                AviBitmapInfoHeader *bi;
331
328
                                
332
329
                                movie->streams[temp].sf= MEM_mallocN(sizeof(AviBitmapInfoHeader), "streamformat");
350
347
                                
351
348
                                fcca = bi->Compression;
352
349
 
353
 
                                if (fcca == FCC ("DIB ") ||
354
 
                                        fcca == FCC ("RGB ") ||
355
 
                                        fcca == FCC ("rgb ") ||
356
 
                                        fcca == FCC ("RAW ") ||
357
 
                                        fcca == FCC ("mjpg") ||
358
 
                                        fcca == FCC ("MJPG") ||
359
 
                                        fcca == 0) {
360
 
                                } else {
361
 
                                        return AVI_ERROR_COMPRESSION;
 
350
                                if ( movie->streams[temp].format ==
 
351
                                         AVI_FORMAT_AVI_RGB) {
 
352
                                        if (fcca == FCC ("DIB ") ||
 
353
                                                fcca == FCC ("RGB ") ||
 
354
                                                fcca == FCC ("rgb ") ||
 
355
                                                fcca == FCC ("RAW ") ||
 
356
                                                fcca == 0 ) {
 
357
                                        } else if ( fcca == FCC ("mjpg") || 
 
358
                                                fcca == FCC ("MJPG")) {
 
359
                                                        movie->streams[temp].format = AVI_FORMAT_MJPEG;
 
360
                                        } else {
 
361
                                                return AVI_ERROR_COMPRESSION;
 
362
                                        }
362
363
                                }
363
364
 
364
 
                        } else fseek (movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
 
365
                        } 
 
366
                        if (j > 0) fseek (movie->fp, j, SEEK_CUR);
365
367
                } else fseek (movie->fp, movie->streams[temp].sf_size, SEEK_CUR);
366
368
                
367
369
                /* Walk to the next LIST */