# HG changeset patch # User aurel # Date 1232577137 0 # Node ID bbb6561a3974e1f3bc76b76d9a188ab81a506606 # Parent 85608ac6c804ab7f3e6e410b11b004f81d0fec00 'code' is used to index a table so make it unsigned this prevents using negative index and possibly crashing with broken files diff -r 85608ac6c804 -r bbb6561a3974 isom.c --- a/isom.c Wed Jan 21 13:27:39 2009 +0000 +++ b/isom.c Wed Jan 21 22:32:17 2009 +0000 @@ -274,7 +274,7 @@ return code; } -int ff_mov_lang_to_iso639(int code, char *to) +int ff_mov_lang_to_iso639(unsigned code, char *to) { int i; /* is it the mangled iso code? */ diff -r 85608ac6c804 -r bbb6561a3974 isom.h --- a/isom.h Wed Jan 21 13:27:39 2009 +0000 +++ b/isom.h Wed Jan 21 22:32:17 2009 +0000 @@ -33,7 +33,7 @@ extern const AVCodecTag ff_codec_movsubtitle_tags[]; int ff_mov_iso639_to_lang(const char *lang, int mp4); -int ff_mov_lang_to_iso639(int code, char *to); +int ff_mov_lang_to_iso639(unsigned code, char *to); typedef struct { int count; diff -r 85608ac6c804 -r bbb6561a3974 mov.c --- a/mov.c Wed Jan 21 13:27:39 2009 +0000 +++ b/mov.c Wed Jan 21 22:32:17 2009 +0000 @@ -494,7 +494,7 @@ AVStream *st = c->fc->streams[c->fc->nb_streams-1]; MOVStreamContext *sc = st->priv_data; int version = get_byte(pb); - int lang; + unsigned lang; if (version > 1) return -1; /* unsupported */