]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
'code' is used to index a table so make it unsigned
authoraurel <aurel@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 21 Jan 2009 22:32:17 +0000 (22:32 +0000)
committeraurel <aurel@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 21 Jan 2009 22:32:17 +0000 (22:32 +0000)
this prevents using negative index and possibly crashing with broken files

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16714 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/isom.c
libavformat/isom.h
libavformat/mov.c

index 73ee3285f0a272b04bc2628cafcfbf6423b336a2..39c58c64dfc9e9da3c39deb6b34bf3f2942a51a9 100644 (file)
@@ -274,7 +274,7 @@ int ff_mov_iso639_to_lang(const char *lang, int mp4)
     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? */
index 934dde83886497cca37136de1348bca8e5ab97d1..2cad5b8b6847107ee84defd97ec44ee2d8fed91c 100644 (file)
@@ -33,7 +33,7 @@ extern const AVCodecTag codec_movaudio_tags[];
 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;
index fc946ea33a769c5f4bcdef9a3c5656a976ebb4e9..0a93444d18ae1e58ae2ef584144f5fb0b69033ed 100644 (file)
@@ -494,7 +494,7 @@ static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     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 */