Skip to content
Permalink
Browse files

Fix some warnings found by enabling suspicious integer conversions

git-svn-id: https://svn.perian.org/trunk@1530 621663c8-3916-0410-8f58-edc14a8543d5
  • Loading branch information...
astrange
astrange committed Nov 16, 2012
1 parent 7253e88 commit 36d1a9a6a6b2e1484180dfffbb96d303de69092f
Showing with 8 additions and 8 deletions.
  1. +2 −2 DataHandlerCallback.h
  2. +1 −1 FFissionCodec/FFissionDecoder.cpp
  3. +2 −2 bitstream_info.c
  4. +2 −2 ff_MovieImport.c
  5. +1 −1 ff_private.c
@@ -41,7 +41,7 @@ class DataHBuffer {
private:
uint8_t *buffer;
size_t allocatedSize;
int64_t fileOffset;
uint64_t fileOffset;
size_t dataSize;

// this clears the buffer
@@ -72,7 +72,7 @@ class DataHandlerCallback:public IOCallback
bool closeHandler;
bool supportsWideOffsets;
open_mode aMode;
SInt64 filesize;
UInt64 filesize;
DataHBuffer dataBuffer;

void Initialize(const open_mode aMode);
@@ -250,7 +250,7 @@ int FFissionDecoder::ConvertXiphVorbisCookie()

int len = headerSize[0] + headerSize[1] + headerSize[2];

if (headerSize[0] <= 0 || headerSize[1] <= 0 || headerSize[2] <= 0 || len >= magicCookieSize) {
if (headerSize[0] <= 0 || headerSize[1] <= 0 || headerSize[2] <= 0 || len >= (int)magicCookieSize) {
Codecprintf(NULL, "Invalid Vorbis extradata\n");
return 0;
}
@@ -847,7 +847,7 @@ static int parse_extra_data_h264(FFusionParserContext *parser, const uint8_t *bu
{
int size = bytestream2_get_be16(&g);
int out_size = 0;
if(size <= 0 || size > bytestream2_get_bytes_left(&g))
if(size <= 0 || size > (int)bytestream2_get_bytes_left(&g))
return 0;
uint8_t *decoded = av_mallocz(size+FF_INPUT_BUFFER_PADDING_SIZE);
if(!decoded)
@@ -862,7 +862,7 @@ static int parse_extra_data_h264(FFusionParserContext *parser, const uint8_t *bu
{
int size = bytestream2_get_be16(&g);
int out_size = 0;
if(size <= 0 || size > bytestream2_get_bytes_left(&g))
if(size <= 0 || size > (int)bytestream2_get_bytes_left(&g))
return 0;
uint8_t *decoded = av_mallocz(size+FF_INPUT_BUFFER_PADDING_SIZE);
if(!decoded)
@@ -471,7 +471,7 @@ ComponentResult FFAvi_MovieImportDataRef(ff_global_ptr storage, Handle dataRef,
int64_t duration = storage->format_context->duration;
if(addedDuration && duration > 0) {
TimeScale movieTimeScale = GetMovieTimeScale(theMovie);
*addedDuration = movieTimeScale * duration / AV_TIME_BASE;
*addedDuration = (movieTimeScale * duration) / AV_TIME_BASE;

//create a placeholder track so that progress displays correctly.
create_placeholder_track(storage->movie, &storage->placeholderTrack, *addedDuration, dataRef, dataRefType);
@@ -480,7 +480,7 @@ ComponentResult FFAvi_MovieImportDataRef(ff_global_ptr storage, Handle dataRef,
//suggest a speed that's faster than the bare minimum.
//if there's an error, the data handler probably doesn't support
//this, so we can just ignore.
DataHPlaybackHints(storage->dataHandler, 0, 0, -1, (storage->dataSize * 1.15) / ((double)duration / AV_TIME_BASE));
DataHPlaybackHints(storage->dataHandler, 0, 0, -1, (storage->dataSize * 1.15) / (duration / (double)AV_TIME_BASE));
}

//import with idle. Decode a little bit of data now.
@@ -276,7 +276,7 @@ OSStatus initialize_audio_map(NCStream *map, Track targetTrack, Handle dataRef,
if(asbd.mFormatID == kAudioFormatAC3 || asbd.mFormatID == 'ms \0')
{
QTMetaDataRef trackMetaData;
OSErr error = QTCopyTrackMetaData(targetTrack, &trackMetaData);
OSStatus error = QTCopyTrackMetaData(targetTrack, &trackMetaData);
if(error == noErr)
{
const char *prop = "Surround";

0 comments on commit 36d1a9a

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.