]> git.sesse.net Git - mlt/commit
mlt_frame_get_waveform(): handle memory allocation failure
authorMikko Rapeli <mikko.rapeli@iki.fi>
Wed, 25 Jul 2012 10:08:34 +0000 (12:08 +0200)
committerMikko Rapeli <mikko.rapeli@iki.fi>
Wed, 25 Jul 2012 22:17:55 +0000 (00:17 +0200)
commita283185c141d85a2d1d72c2c0f1efbbeda070864
tree5f48b4df86589df8f76262debb38ee430c32d945
parentd04932a50fedcc65ed107d1ac7d2869f75485872
mlt_frame_get_waveform(): handle memory allocation failure

Fixes Coverity CID 709347.

At conditional (1): "bitmap != NULL" taking the false branch.
CID 709347: Dereference after null check (FORWARD_NULL)
Comparing "bitmap" to null implies that "bitmap" might be null.
 802        if ( bitmap != NULL )
 803                memset( bitmap, 0, size );
 804        mlt_properties_set_data( properties, "waveform", bitmap, size, ( mlt_destructor )mlt_pool_release, NULL );
...
 826                        // Position buffer pointer using y coordinate, stride, and x coordinate
Assigning null: "p" = "bitmap + i / skip + displacement * w".
 827                        unsigned char *p = bitmap + i / skip + displacement * w;
...
 831                                if ( *pcm < 0 )
Dereferencing null variable "p".
 832                                        p[ w * k ] = ( k == 0 ) ? 0xFF : p[ w * k ] + gray;
 833                                else
Dereferencing null variable "p".
 834                                        p[ w * k ] = ( k == height ) ? 0xFF : p[ w * k ] + gray;
src/framework/mlt_frame.c