Mercurial > libavformat.hg
changeset 4586:674bf341b7e3 libavformat
return -1 for errors in ff_mov_iso639_to_lang() to allow for error checking
author | aurel |
---|---|
date | Thu, 26 Feb 2009 13:11:18 +0000 |
parents | f777070fd15b |
children | b41ab5937218 |
files | isom.c movenc.c |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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); }
--- 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) {