summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorvan <[email protected]>2008-07-29 18:50:28 +0000
committervan <[email protected]>2008-07-29 18:50:28 +0000
commit9cac61c6debd505c7a4fb88c01d6dd2342896a8b (patch)
tree6944d1d63979077d487c3ed5c89f50498e9a0436 /libhb
parent73bcc75d303988c45aa21e9d11a5e09199180e18 (diff)
Don't lose our existing buffer chain when nal_encode returns NULL.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1592 b64f7644-9d1e-0410-96f1-a4d463321fa5
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;
}
}