]> git.sesse.net Git - ffmpeg/blobdiff - vhook/fish.c
Prevent scalefactors from overflowing.
[ffmpeg] / vhook / fish.c
index a2dbd2f27b9570c6b17c8f9027971452dd846aaa..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;
@@ -230,7 +230,7 @@ static void get_hsv(HSV *hsv, int r, int g, int b)
 void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, int height, int64_t pts)
 {
     ContextInfo *ci = (ContextInfo *) ctx;
-    uint8_t *cm = cropTbl + MAX_NEG_CROP;
+    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
     int rowsize = picture->linesize[0];
 
 #if 0
@@ -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