]>
git.sesse.net Git - mlt/commit
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;