GNOME Bugzilla – Bug 768757
hlsdemux: crash with encrypted stream with OpenSSL
Last modified: 2016-10-31 14:02:52 UTC
Created attachment 331382 [details] [review] hlsdemux: don't call gst_hls_demux_decrypt_end() in gst_hls_demux_clear_pending_data() With 8fd6eee3f68b07f7ba92a9c407fe75ae2ce00300 ("hlsdemux: Clear pending data when needed") hlsdemux crashes for http://filmrommet.no/film/playlist.m3u8?id=12450%20TR=1%20type=m3u8 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 18438] 0x00007fffdeac6b7d in EVP_DecryptUpdate (ctx=ctx@entry=0x7fffd8134530, out=out@entry=0x7fffcc003890 "", outl=outl@entry=0x7fffde1cb9c0, in=0x7fffc0007cf0 "[*q\353\027\r\316\321\035Ň\306=\341A7*ì\324j\341\201\301\307ޡc̉\034\322\"\361@\234oXF:,\362\001*\212\016\211\211#\206w\204\ve\006\212걭QC\034\226!\306\330v\262\004\vJ\250\264rT\030\257\272`\232\323e\263*8z\205\327\031\237*\226>\225\020\275\r\001ks\377\066\204\233\r\263\225\311", <incomplete sequence \344>, inl=976) at evp_enc.c:423 423 if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { (gdb) bt
+ Trace 236461
ctx->cipher is NULL here. It's deleted immediately after creating it in gst_hls_demux_start_fragment(). Patch attached.
Fixed, slightly differently: commit af652af6f05c6eaf8d109692f3c9f178c6c9e6b5 Author: Jan Schmidt <jan@centricular.com> Date: Tue Jul 19 02:11:54 2016 +1000 hlsdemux: Fix clearing of decryption state Don't clear decryption state immediately after initialising it in the start_fragment. Don't clear the state of all streams when we want to only clear the current stream.