Commit 564be88c authored by reimar's avatar reimar

Fix nodes[nb_codes*2-1].count being uninitialized and used to initialize

nodes[nb_codes*2-2].count (thus making that invalid as well) in
ff_huff_build_tree.
Might fix some (hard to reproduce) crashes in VP6 decoder.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11119 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ea4eb683
......@@ -82,6 +82,7 @@ int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
}
qsort(nodes, nb_codes, sizeof(Node), cmp);
cur_node = nb_codes;
nodes[nb_codes*2-1].count = 0;
for(i = 0; i < nb_codes*2-1; i += 2){
nodes[cur_node].sym = HNODE;
nodes[cur_node].count = nodes[i].count + nodes[i+1].count;
......
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