diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-05-20 17:02:16 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-07-03 16:09:07 +0200 |
commit | ff753f41dd3dbe7b71c314ecfe4b9dd89e059f57 (patch) | |
tree | ed21910392baa3642a96f18829bab70280ae2e04 /libswscale/swscale.c | |
parent | 1b11a324feb56ec70161f856c5fb103363cff0af (diff) | |
download | ffmpeg-ff753f41dd3dbe7b71c314ecfe4b9dd89e059f57.tar.gz |
sws: merge handling frame start into a single block
Also, return an error code on failure rather than 0.
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r-- | libswscale/swscale.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 0f05ba01f6..62a172d4ec 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -912,11 +912,12 @@ int attribute_align_arg sws_scale(struct SwsContext *c, if (srcSliceH == 0) return 0; - if (frame_start && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) { - av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n"); - return 0; - } if (frame_start) { + if (srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) { + av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n"); + return AVERROR(EINVAL); + } + if (srcSliceY == 0) c->sliceDir = 1; else c->sliceDir = -1; } |