Commit dce25564 authored by Aurelien Jacobs's avatar Aurelien Jacobs

'code' is used to index a table so make it unsigned

this prevents using negative index and possibly crashing with broken files

Originally committed as revision 16714 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 448887a6
...@@ -274,7 +274,7 @@ int ff_mov_iso639_to_lang(const char *lang, int mp4) ...@@ -274,7 +274,7 @@ int ff_mov_iso639_to_lang(const char *lang, int mp4)
return code; return code;
} }
int ff_mov_lang_to_iso639(int code, char *to) int ff_mov_lang_to_iso639(unsigned code, char *to)
{ {
int i; int i;
/* is it the mangled iso code? */ /* is it the mangled iso code? */
......
...@@ -33,7 +33,7 @@ extern const AVCodecTag codec_movaudio_tags[]; ...@@ -33,7 +33,7 @@ extern const AVCodecTag codec_movaudio_tags[];
extern const AVCodecTag ff_codec_movsubtitle_tags[]; extern const AVCodecTag ff_codec_movsubtitle_tags[];
int ff_mov_iso639_to_lang(const char *lang, int mp4); 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 { typedef struct {
int count; int count;
......
...@@ -494,7 +494,7 @@ static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) ...@@ -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]; AVStream *st = c->fc->streams[c->fc->nb_streams-1];
MOVStreamContext *sc = st->priv_data; MOVStreamContext *sc = st->priv_data;
int version = get_byte(pb); int version = get_byte(pb);
int lang; unsigned lang;
if (version > 1) if (version > 1)
return -1; /* unsupported */ return -1; /* unsupported */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment