changeset 4269:bbb6561a3974 libavformat

'code' is used to index a table so make it unsigned this prevents using negative index and possibly crashing with broken files
author aurel
date Wed, 21 Jan 2009 22:32:17 +0000
parents 85608ac6c804
children 96a3395e803b
files isom.c isom.h mov.c
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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? */
--- 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;
--- 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 */