]> git.sesse.net Git - mlt/commitdiff
producer_pango.c: check for null pointer
authorMikko Rapeli <mikko.rapeli@iki.fi>
Mon, 30 Jul 2012 11:07:28 +0000 (13:07 +0200)
committerMikko Rapeli <mikko.rapeli@iki.fi>
Mon, 6 Aug 2012 16:37:24 +0000 (18:37 +0200)
Fixes Coverity CID 710867: Dereference before null check (REVERSE_INULL)
Dereferencing pointer "text". (The dereference is assumed on the basis of the 'nonnull' parameter attribute.)
312                size_t inbuf_n = strlen( text );
...
Dereferencing "text" before a null check.
319                if ( text != NULL && strcmp( text, "" ) && iconv( cd, &inbuf_p, &inbuf_n, &outbuf_p, &outbuf_n ) != -1 )

src/modules/gtk2/producer_pango.c

index ea20448c1bf87794ee270b077e47f72eb657a9df..7c9edb5734afb3a53af3be779ddc0984e79b5f8d 100644 (file)
@@ -310,7 +310,7 @@ static int iconv_utf8( mlt_properties properties, const char *prop_name, const c
        int result = -1;
        
        iconv_t cd = iconv_open( "UTF-8", encoding );
-       if ( cd != ( iconv_t )-1 )
+       if ( text && ( cd != ( iconv_t )-1 ) )
        {
                char *inbuf_p = text;
                size_t inbuf_n = strlen( text );