Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[vaapi] Fix crash while playing mpeg2 files #1954

Merged
1 commit merged into from

4 participants

@anuj-m

This fixes the crash while playing MPEG2 files with sequence display extension. Files with this extension in the header cause the decoder to re-init resulting in a crash.

@anuj-m anuj-m Ensure that the decoder is init once only.
This fixes the crash while playing MPEG2 files with sequence display extension.
6d637d4
@elupus elupus was assigned
@ghost ghost merged commit 53a3ddb into from
@MartijnKaijser MartijnKaijser referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@FernetMenta
Collaborator

This cases ugly malloc/free segfaults all over the place when playing vc-1. Was really hard to track down. Why was this needed?

Collaborator

Verified on my intel rigs. VC-1 does not corrupt the heap anymore. We cannot just set it to NULL in case of VC-1 it might still be in use. Why not handle it as the others do? if not NULL return *cur;

Edit: Sorry, just remove it. It is handled in the Decoder itself, just create a new one.

@elupus
Collaborator

I need to add something like this again, but in a more complete way: elupus@740b28a

Can we reproduce the issues?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 18, 2012
  1. @anuj-m

    Ensure that the decoder is init once only.

    anuj-m authored
    This fixes the crash while playing MPEG2 files with sequence display extension.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
View
5 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
@@ -105,6 +105,11 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
if(*cur == PIX_FMT_VAAPI_VLD && g_guiSettings.GetBool("videoplayer.usevaapi")
&& (avctx->codec_id != CODEC_ID_MPEG4 || g_advancedSettings.m_videoAllowMpeg4VAAPI))
{
+ if (ctx->GetHardware() != NULL)
+ {
+ ctx->SetHardware(NULL);
+ }
+
VAAPI::CDecoder* dec = new VAAPI::CDecoder();
if(dec->Open(avctx, *cur))
{
Something went wrong with that request. Please try again.