]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_gradfun.c
Merge commit 'bb9378251a167ef0116f263912e57f715c1e02ac'
[ffmpeg] / libavfilter / vf_gradfun.c
index f9dec77185dc27c2a73ef519b18d602545d8236c..b2e700742fad6df6472d5356c150470c6fa94685 100644 (file)
@@ -25,7 +25,7 @@
  * libmpcodecs/vf_gradfun.c
  *
  * Apply a boxblur debanding algorithm (based on the gradfun2db
- * Avisynth filter by prunedtree).
+ * AviSynth filter by prunedtree).
  * Foreach pixel, if it's within threshold of the blurred value, make it closer.
  * So now we have a smoothed and higher bitdepth version of all the shallow
  * gradients, while leaving detailed areas untouched.
@@ -199,7 +199,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         av_frame_copy_props(out, in);
     }
 
-    for (p = 0; p < 4 && in->data[p]; p++) {
+    for (p = 0; p < 4 && in->data[p] && in->linesize[p]; p++) {
         int w = inlink->w;
         int h = inlink->h;
         int r = s->radius;