summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-11-14 12:53:41 -0800
committerJohn Stebbins <[email protected]>2019-11-14 13:09:11 -0800
commitb5653e33a7ce9258e204bbd3a12a9855c2abd050 (patch)
treeaf94868f3f7fd81538c4d1738461339d01e6c0d0
parent3e2e630a1c8f5ef9c05e9cb60565f8351e2db7fa (diff)
hbffmpeg: fix handline of negative AVFrame linesize
AVFrame can have a negative linesize. avfilter vf_vflip does this. Fixes https://github.com/HandBrake/HandBrake/issues/2406 (cherry picked from commit 753f6a943d879285f2104ce918ccba6151ae5d21)
-rw-r--r--libhb/hbffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libhb/hbffmpeg.c b/libhb/hbffmpeg.c
index f5a140c75..f9edc4bd1 100644
--- a/libhb/hbffmpeg.c
+++ b/libhb/hbffmpeg.c
@@ -103,7 +103,7 @@ hb_buffer_t * hb_avframe_to_video_buffer(AVFrame *frame, AVRational time_base)
int stride = buf->plane[pp].stride;
int height = buf->plane[pp].height;
int linesize = frame->linesize[pp];
- int size = linesize < stride ? linesize : stride;
+ int size = linesize < stride ? ABS(linesize) : stride;
uint8_t * dst = buf->plane[pp].data;
uint8_t * src = frame->data[pp];