[FFmpeg-cvslog] avcodec/ffv1enc: do not offset null pointers

Michael Niedermayer git at videolan.org
Wed Aug 17 00:56:30 EEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Aug 16 23:05:27 2016 +0200| [a95fdac4c6203037a4690a4f7960223c8daad73e] | committer: Michael Niedermayer

avcodec/ffv1enc: do not offset null pointers

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a95fdac4c6203037a4690a4f7960223c8daad73e
---

 libavcodec/ffv1enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 0a72591..dc9c499 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -1007,8 +1007,8 @@ static int encode_slice(AVCodecContext *c, void *arg)
     int ret;
     RangeCoder c_bak = fs->c;
     const uint8_t *planes[3] = {p->data[0] + ps*x + y*p->linesize[0],
-                                p->data[1] + ps*x + y*p->linesize[1],
-                                p->data[2] + ps*x + y*p->linesize[2]};
+                                p->data[1] ? p->data[1] + ps*x + y*p->linesize[1] : NULL,
+                                p->data[2] ? p->data[2] + ps*x + y*p->linesize[2] : NULL};
 
     fs->slice_coding_mode = 0;
     if (f->version > 3) {



More information about the ffmpeg-cvslog mailing list