Browse code

lavfi/buffersrc: do not dereference NULL frame.

frame = NULL is used to indicate EOF.

Nicolas George authored on 2013/03/11 00:28:33
Showing 1 changed files
... ...
@@ -93,9 +93,9 @@ int av_buffersrc_add_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags
93 93
 {
94 94
     AVFrame *copy = NULL;
95 95
     int ret = 0;
96
-    int64_t layout = frame->channel_layout;
97 96
 
98
-    if (layout && av_get_channel_layout_nb_channels(layout) != av_frame_get_channels(frame)) {
97
+    if (frame && frame->channel_layout &&
98
+        av_get_channel_layout_nb_channels(frame->channel_layout) != av_frame_get_channels(frame)) {
99 99
         av_log(0, AV_LOG_ERROR, "Layout indicates a different number of channels than actually present\n");
100 100
         return AVERROR(EINVAL);
101 101
     }