filter_swscale.c: throw assert if creation of swscale context fails.
[melted] / src / modules / avformat / filter_swscale.c
index 1a31a87..bcb68dd 100644 (file)
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <assert.h>
 
 static inline int is_big_endian( )
 {
@@ -125,6 +126,7 @@ static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format iform
 
        // Create the context and output image
        struct SwsContext *context = sws_getContext( iwidth, iheight, iformat, owidth, oheight, oformat, interp, NULL, NULL, NULL);
+       assert(swscale);
 
        // Perform the scaling
        sws_scale( context, input.data, input.linesize, 0, iheight, output.data, output.linesize);