summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
Diffstat (limited to 'libhb')
-rw-r--r--libhb/encx264.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c
index ebd9f4bb5..f40903d9d 100644
--- a/libhb/encx264.c
+++ b/libhb/encx264.c
@@ -582,11 +582,14 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
break;
hb_buffer_t *buf = nal_encode( w, &pic_out, i_nal, nal );
- if ( last_buf == NULL )
- *buf_out = buf;
- else
- last_buf->next = buf;
- last_buf = buf;
+ if ( buf )
+ {
+ if ( last_buf == NULL )
+ *buf_out = buf;
+ else
+ last_buf->next = buf;
+ last_buf = buf;
+ }
}
// Flushed everything - add the eof to the end of the chain.
if ( last_buf == NULL )
@@ -638,11 +641,14 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
new_stop = orig_stop;
in->stop = new_stop;
hb_buffer_t *buf = x264_encode( w, in );
- if ( last_buf == NULL )
- *buf_out = buf;
- else
- last_buf->next = buf;
- last_buf = buf;
+ if ( buf )
+ {
+ if ( last_buf == NULL )
+ *buf_out = buf;
+ else
+ last_buf->next = buf;
+ last_buf = buf;
+ }
in->start = new_stop;
}
}