]> git.sesse.net Git - ffmpeg/blobdiff - vhook/fish.c
Prevent scalefactors from overflowing.
[ffmpeg] / vhook / fish.c
index 2a30d2847d724d3b56d1e5a747be0c40c461d069..f0cd0085ccf15cf89548860697c809ccb69771a6 100644 (file)
 #include <stdio.h>
 #include <dirent.h>
 
-#include "framehook.h"
-#include "dsputil.h"
-#include "avformat.h"
-#include "swscale.h"
+#include "libavformat/avformat.h"
+#include "libavformat/framehook.h"
+#include "libavcodec/dsputil.h"
+#include "libswscale/swscale.h"
 
 static int sws_flags = SWS_BICUBIC;
 
@@ -124,7 +124,7 @@ int Configure(void **ctxp, int argc, char *argv[])
     *ctxp = av_mallocz(sizeof(ContextInfo));
     ci = (ContextInfo *) *ctxp;
 
-    optind = 0;
+    optind = 1;
 
     ci->dir = "/tmp";
     ci->threshold = 100;
@@ -354,7 +354,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
                 if (ci->toRGB_convert_ctx == NULL) {
                     av_log(NULL, AV_LOG_ERROR,
                            "Cannot initialize the toRGB conversion context\n");
-                    exit(1);
+                    return;
                 }
                 // img_convert parameters are          2 first destination, then 4 source
                 // sws_scale   parameters are context, 4 first source,      then 2 destination