Workaround a potential segfault when using VAAPI/DXVA2 (close #3606).
Workaround a potential segfault when using VAAPI/DXVA2 (close #3606).

It seems that some avcodec decoders release frames even after being flushed.

vlc-mirror/vlc,vlc-mirror/vlc-2.1,krichter722/vlc,jomanmuk/vlc-2.2,shyamalschandra/vlc,vlc-mirror/vlc,xkfz007/vlc,jomanmuk/vlc-2.2,jomanmuk/vlc-2.1,krichter722/vlc,vlc-mirror/vlc-2.1,shyamalschandra/vlc,jomanmuk/vlc-2.2,jomanmuk/vlc-2.2,xkfz007/vlc,krichter722/vlc,shyamalschandra/vlc,vlc-mirror/vlc-2.1,shyamalschandra/vlc,krichter722/vlc,krichter722/vlc,vlc-mirror/vlc,jomanmuk/vlc-2.1,jomanmuk/vlc-2.1,jomanmuk/vlc-2.1,shyamalschandra/vlc,shyamalschandra/vlc,jomanmuk/vlc-2.2,shyamalschandra/vlc,xkfz007/vlc,xkfz007/vlc,vlc-mirror/vlc-2.1,jomanmuk/vlc-2.2,krichter722/vlc,vlc-mirror/vlc,vlc-mirror/vlc-2.1,vlc-mirror/vlc,xkfz007/vlc,jomanmuk/vlc-2.1,vlc-mirror/vlc-2.1,vlc-mirror/vlc-2.1,vlc-mirror/vlc,krichter722/vlc,jomanmuk/vlc-2.1,jomanmuk/vlc-2.2,xkfz007/vlc,xkfz007/vlc,jomanmuk/vlc-2.1,vlc-mirror/vlc