diff options
author | John Stebbins <[email protected]> | 2015-11-06 13:24:27 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-11-06 13:24:27 -0800 |
commit | 96b99eae832a268f8445d438aec3e7bd2dabc88b (patch) | |
tree | cc64bd7b4c2872651cba449d324874f4288be06d /libhb | |
parent | f7b0c5773abe43b003295ecf631c83cc43a1ee91 (diff) |
decavcodec: don't try to memset NULL buffers
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/decavcodec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 215a58902..ab8011922 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -532,7 +532,10 @@ static int decavcodecaWork( hb_work_object_t * w, hb_buffer_t ** buf_in, // libavcodec/mpeg12dec.c requires buffers to be zero padded. // If not zero padded, it can get stuck in an infinite loop. // It's likely there are other decoders that expect the same. - memset(in->data + in->size, 0, in->alloc - in->size); + if (in->data != NULL) + { + memset(in->data + in->size, 0, in->alloc - in->size); + } if (in->s.flags & HB_BUF_FLAG_EOF) { @@ -1790,7 +1793,10 @@ static int decavcodecvWork( hb_work_object_t * w, hb_buffer_t ** buf_in, // libavcodec/mpeg12dec.c requires buffers to be zero padded. // If not zero padded, it can get stuck in an infinite loop. // It's likely there are other decoders that expect the same. - memset(in->data + in->size, 0, in->alloc - in->size); + if (in->data != NULL) + { + memset(in->data + in->size, 0, in->alloc - in->size); + } /* if we got an empty buffer signaling end-of-stream send it downstream */ if (in->s.flags & HB_BUF_FLAG_EOF) |