summaryrefslogtreecommitdiffstats
path: root/libhb/decomb.c
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2017-08-07 07:14:40 +0200
committerDamiano Galassi <[email protected]>2017-08-07 07:14:40 +0200
commitfaacd7ca91da185f2a7174e1321c2859da6383b8 (patch)
treea402150c7aa693e07dfba40953a38958f11c782c /libhb/decomb.c
parentb17018b5a420710637d8c7f0ea44c3b2f1ce4f2b (diff)
decomb: add an additional null check to avoid a crash if the filter receive the EOF flag before reciving a valid frame.
Diffstat (limited to 'libhb/decomb.c')
-rw-r--r--libhb/decomb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libhb/decomb.c b/libhb/decomb.c
index 22f53de9c..d3a62cee3 100644
--- a/libhb/decomb.c
+++ b/libhb/decomb.c
@@ -1281,9 +1281,12 @@ static int hb_decomb_work( hb_filter_object_t * filter,
*buf_in = NULL;
if (in->s.flags & HB_BUF_FLAG_EOF)
{
- // Duplicate last frame and process refs
- store_ref(pv, hb_buffer_dup(pv->ref[2]));
- process_frame(pv);
+ if (pv->ref[2] != NULL)
+ {
+ // Duplicate last frame and process refs
+ store_ref(pv, hb_buffer_dup(pv->ref[2]));
+ process_frame(pv);
+ }
hb_buffer_list_append(&pv->out_list, in);
*buf_out = hb_buffer_list_clear(&pv->out_list);
return HB_FILTER_DONE;