ffv1: fix calculating slice dimensions for version 2
authorAnton Khirnov <anton@khirnov.net>
Tue, 19 Feb 2013 07:15:07 +0000 (08:15 +0100)
committerAnton Khirnov <anton@khirnov.net>
Fri, 8 Mar 2013 07:10:02 +0000 (08:10 +0100)
It got broken in 0f13cd3187192ba0cc2b043430de6e279e7b97c3.

CC:libav-stable@libav.org

libavcodec/ffv1dec.c

index f9b094d..c4f73c7 100644 (file)
@@ -734,8 +734,8 @@ static int read_header(FFV1Context *f)
 
             fs->slice_x      /= f->num_h_slices;
             fs->slice_y      /= f->num_v_slices;
 
             fs->slice_x      /= f->num_h_slices;
             fs->slice_y      /= f->num_v_slices;
-            fs->slice_width  /= f->num_h_slices - fs->slice_x;
-            fs->slice_height /= f->num_v_slices - fs->slice_y;
+            fs->slice_width  = fs->slice_width  / f->num_h_slices - fs->slice_x;
+            fs->slice_height = fs->slice_height / f->num_v_slices - fs->slice_y;
             if ((unsigned)fs->slice_width > f->width ||
                 (unsigned)fs->slice_height > f->height)
                 return AVERROR_INVALIDDATA;
             if ((unsigned)fs->slice_width > f->width ||
                 (unsigned)fs->slice_height > f->height)
                 return AVERROR_INVALIDDATA;