summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2018-05-29 12:59:42 -0700
committerJohn Stebbins <[email protected]>2018-05-29 12:59:42 -0700
commit4b3aa7b434e5af45997cdd8c34a310aa654a304b (patch)
tree2105157232c98023147311ff4d5c2718f4d7950f
parentab9a2d7b3da4d62c1d4958de8c988c165e2d70dd (diff)
libhb: fix segfault when decoding empty audio track
If an audio track exists, but we receive no audio packets for that track, this causes a condition that results in a NULL dereference. Fixes https://github.com/HandBrake/HandBrake/issues/1358
-rw-r--r--libhb/decavcodec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index 26430dce4..3e444413d 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -2137,7 +2137,8 @@ static void decodeAudio(hb_work_private_t *pv, packet_info_t * packet_info)
// libav does not supply timestamps for wmapro audio (possibly others)
// if there is an input timestamp, initialize next_pts
if (pv->next_pts == (int64_t)AV_NOPTS_VALUE &&
- packet_info->pts != AV_NOPTS_VALUE)
+ packet_info != NULL &&
+ packet_info->pts != AV_NOPTS_VALUE)
{
pv->next_pts = packet_info->pts;
}