# HG changeset patch # User aurel # Date 1235653878 0 # Node ID 674bf341b7e3e3ed014f55934e881d52742fc356 # Parent f777070fd15b392690192bac30c852d55acfc6a2 return -1 for errors in ff_mov_iso639_to_lang() to allow for error checking diff -r f777070fd15b -r 674bf341b7e3 isom.c --- a/isom.c Thu Feb 26 13:08:22 2009 +0000 +++ b/isom.c Thu Feb 26 13:11:18 2009 +0000 @@ -257,7 +257,7 @@ } /* XXX:can we do that in mov too? */ if (!mp4) - return 0; + return -1; /* handle undefined as such */ if (lang[0] == '\0') lang = "und"; @@ -265,9 +265,9 @@ for (i = 0; i < 3; i++) { unsigned char c = (unsigned char)lang[i]; if (c < 0x60) - return 0; + return -1; if (c > 0x60 + 0x1f) - return 0; + return -1; code <<= 5; code |= (c - 0x60); } diff -r f777070fd15b -r 674bf341b7e3 movenc.c --- a/movenc.c Thu Feb 26 13:08:22 2009 +0000 +++ b/movenc.c Thu Feb 26 13:11:18 2009 +0000 @@ -1651,6 +1651,8 @@ track->enc = st->codec; track->language = ff_mov_iso639_to_lang(lang?lang->value:"und", mov->mode!=MODE_MOV); + if (track->language < 0) + track->language = 0; track->mode = mov->mode; track->tag = mov_find_codec_tag(s, track); if (!track->tag) {