]> granicus.if.org Git - handbrake/commitdiff
decutf8sub: fix a bug when passing subtitles through to MP4.
authorRodeo <tdskywalker@gmail.com>
Tue, 19 Mar 2013 17:35:45 +0000 (17:35 +0000)
committerRodeo <tdskywalker@gmail.com>
Tue, 19 Mar 2013 17:35:45 +0000 (17:35 +0000)
The decoder was setting the last character but forgot to increment out->size,
which led to weird artifacts being displayed when playing in e.g. VLC.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5346 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/decutf8sub.c

index cf86678d76c11b43cbbba499ce0e51f885de904b..812569279b27b9150a76e5fcbb8e597905652ee9 100644 (file)
@@ -45,7 +45,7 @@ static int decutf8Work( hb_work_object_t * w, hb_buffer_t ** buf_in,
     if ( out->size > 0 && out->data[out->size - 1] != '\0' ) {
         // NOTE: out->size remains unchanged
         hb_buffer_realloc( out, out->size + 1 );
-        out->data[out->size] = '\0';
+        out->data[out->size++] = '\0';
     }
     
     *buf_in = NULL;