Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1182)

Unified Diff: r19355_invalid_huffman_table.patch

Issue 164120: Add patches for block-level quant in theora, -O2 on build, and statically link pthread on Windows (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « r19351_theora_decode_tables_limit127.patch ('k') | r19356_theora_decode_init_error_passing.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: r19355_invalid_huffman_table.patch
===================================================================
--- r19355_invalid_huffman_table.patch (revision 0)
+++ r19355_invalid_huffman_table.patch (revision 0)
@@ -0,0 +1,71 @@
+commit baa697105bd3e754076573ada39d3382c8f6968a
+Author: reimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
+Date: Mon Jul 6 09:22:39 2009 +0000
+
+ Make decode_init fail if the huffman tables are invalid and thus init_vlc fails.
+ Otherwise this will crash during decoding because the vlc tables are NULL.
+ Partially fixes ogv/smclock.ogv.1.101.ogv from issue 1240.
+
+
+ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19355 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
+
+diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
+index ad32cc9..3f45428 100644
+--- a/libavcodec/vp3.c
++++ b/libavcodec/vp3.c
+@@ -1788,29 +1788,34 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
+ for (i = 0; i < 16; i++) {
+
+ /* DC histograms */
+- init_vlc(&s->dc_vlc[i], 5, 32,
++ if (init_vlc(&s->dc_vlc[i], 5, 32,
+ &s->huffman_table[i][0][1], 4, 2,
+- &s->huffman_table[i][0][0], 4, 2, 0);
++ &s->huffman_table[i][0][0], 4, 2, 0) < 0)
++ goto vlc_fail;
+
+ /* group 1 AC histograms */
+- init_vlc(&s->ac_vlc_1[i], 5, 32,
++ if (init_vlc(&s->ac_vlc_1[i], 5, 32,
+ &s->huffman_table[i+16][0][1], 4, 2,
+- &s->huffman_table[i+16][0][0], 4, 2, 0);
++ &s->huffman_table[i+16][0][0], 4, 2, 0) < 0)
++ goto vlc_fail;
+
+ /* group 2 AC histograms */
+- init_vlc(&s->ac_vlc_2[i], 5, 32,
++ if (init_vlc(&s->ac_vlc_2[i], 5, 32,
+ &s->huffman_table[i+16*2][0][1], 4, 2,
+- &s->huffman_table[i+16*2][0][0], 4, 2, 0);
++ &s->huffman_table[i+16*2][0][0], 4, 2, 0) < 0)
++ goto vlc_fail;
+
+ /* group 3 AC histograms */
+- init_vlc(&s->ac_vlc_3[i], 5, 32,
++ if (init_vlc(&s->ac_vlc_3[i], 5, 32,
+ &s->huffman_table[i+16*3][0][1], 4, 2,
+- &s->huffman_table[i+16*3][0][0], 4, 2, 0);
++ &s->huffman_table[i+16*3][0][0], 4, 2, 0) < 0)
++ goto vlc_fail;
+
+ /* group 4 AC histograms */
+- init_vlc(&s->ac_vlc_4[i], 5, 32,
++ if (init_vlc(&s->ac_vlc_4[i], 5, 32,
+ &s->huffman_table[i+16*4][0][1], 4, 2,
+- &s->huffman_table[i+16*4][0][0], 4, 2, 0);
++ &s->huffman_table[i+16*4][0][0], 4, 2, 0) < 0)
++ goto vlc_fail;
+ }
+ }
+
+@@ -1844,6 +1849,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
+ }
+
+ return 0;
++
++vlc_fail:
++ av_log(avctx, AV_LOG_FATAL, "Invalid huffman table\n");
++ return -1;
+ }
+
+ /*
Property changes on: r19355_invalid_huffman_table.patch
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « r19351_theora_decode_tables_limit127.patch ('k') | r19356_theora_decode_init_error_passing.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698