Commit b64149c0 authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

stream_filter: smooth: fix write overflow

(cherry picked from commit 04b5c18015781108cd39d5617751afce5e5dcfdf)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 91603afb
......@@ -344,8 +344,9 @@ static int build_smoo_box( stream_t *s, uint8_t *smoo_box )
if( !qlvl->CodecPrivateData )
continue;
stra_box[98] = stra_box[99] = stra_box[100] = 0; /* reserved */
assert( strlen( qlvl->CodecPrivateData ) < 512 );
stra_box[101] = strlen( qlvl->CodecPrivateData ) / 2;
if ( stra_box[101] > STRA_SIZE - 102 )
stra_box[101] = STRA_SIZE - 102;
uint8_t *binary_cpd = decode_string_hex_to_binary( qlvl->CodecPrivateData );
memcpy( stra_box + 102, binary_cpd, stra_box[101] );
free( binary_cpd );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment