SMPTE-TT : Removed appearance of garbage value in color code.#620
SMPTE-TT : Removed appearance of garbage value in color code.#620saurabhshri wants to merge 1 commit intoCCExtractor:masterfrom saurabhshri:patch-13
Conversation
|
Instead of *color_code = NULL; Just use Also be aware that strncat (or strncpy) don't null terminate the destination string, so you need to do it yourself. (context->subline) + (temp_pointer - (context->subline) + 1) That's a weird thing to do. Why not just temp_pointer+1 ? |
|
@cfsmp3 Earlier I too was using Where else And regarding I'll change it to Does it sound okay? |
|
Also do color_code[7] instead of * and then malloc... 7 bytes it's OK to get from the stack, no need to deal with dynamic alloc. You can even init that block to all 0s. |
Also polished and improved existing code. More details : #620
Today we made Sample Platform's difference generator a little better and found out that for SMPTE-TT font color often contains garbage data.
When I added that font color support, I left
color_codevariable uninitialized and hence this garbage value. This hopefully fixes this.