]> git.sesse.net Git - mlt/commitdiff
fix possible crash in mlt_frame_get_waveform
authorj-b-m <jb@kdenlive.org>
Sun, 14 Oct 2012 17:07:12 +0000 (10:07 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 14 Oct 2012 17:08:00 +0000 (10:08 -0700)
src/framework/mlt_frame.c

index 36cba041aaf63cde956903874fea50346ef247c7..677a51610527f97ba6d94025d43c187a64ccc013 100644 (file)
@@ -821,6 +821,8 @@ unsigned char *mlt_frame_get_waveform( mlt_frame self, int w, int h )
 
        // Make an 8-bit buffer large enough to hold rendering
        int size = w * h;
+       if ( size <= 0 )
+               return NULL;
        unsigned char *bitmap = ( unsigned char* )mlt_pool_alloc( size );
        if ( bitmap != NULL )
                memset( bitmap, 0, size );