]> git.sesse.net Git - mlt/commitdiff
add null pointer check on return from mlt_frame_get_audio
authorDan Dennedy <dan@dennedy.org>
Sat, 4 Feb 2012 20:58:48 +0000 (12:58 -0800)
committerDan Dennedy <dan@dennedy.org>
Sat, 4 Feb 2012 20:59:04 +0000 (12:59 -0800)
src/modules/avformat/consumer_avformat.c

index df1cc0f2301a64773e9419c4a17e46156f5828a9..7d6141e7fb5855abaeb8d0d3adce0e7132fcf105 100644 (file)
@@ -1501,15 +1501,16 @@ static void *consumer_thread( void *arg )
                                        fifo = sample_fifo_init( frequency, channels );
                                        mlt_properties_set_data( properties, "sample_fifo", fifo, 0, ( mlt_destructor )sample_fifo_close, NULL );
                                }
+                               if ( pcm )
+                               {
+                                       // Silence if not normal forward speed
+                                       if ( mlt_properties_get_double( frame_properties, "_speed" ) != 1.0 )
+                                               memset( pcm, 0, samples * channels * sample_bytes );
 
-                               // Silence if not normal forward speed
-                               if ( mlt_properties_get_double( frame_properties, "_speed" ) != 1.0 )
-                                       memset( pcm, 0, samples * channels * sample_bytes );
-
-                               // Append the samples
-                               sample_fifo_append( fifo, pcm, samples * channels * sample_bytes );
-                               total_time += ( samples * 1000000 ) / frequency;
-
+                                       // Append the samples
+                                       sample_fifo_append( fifo, pcm, samples * channels * sample_bytes );
+                                       total_time += ( samples * 1000000 ) / frequency;
+                               }
                                if ( !video_st )
                                        mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
                        }