Permalink
Browse files

xvba: decoder, make sure AVFrame is initialized if FFGetBuffer fails.…

… credits to Kelly Anderson
  • Loading branch information...
1 parent 23423a8 commit 628f4906a2e64360b08c6d6325b2c9bd422b138e @FernetMenta committed Dec 15, 2011
Showing with 10 additions and 8 deletions.
  1. +10 −8 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp
View
18 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp
@@ -912,6 +912,16 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic)
CDecoder* xvba = (CDecoder*)ctx->GetHardware();
struct pictureAge* pA = &xvba->picAge;
+ pic->data[0] =
+ pic->data[1] =
+ pic->data[2] =
+ pic->data[3] = 0;
+
+ pic->linesize[0] =
+ pic->linesize[1] =
+ pic->linesize[2] =
+ pic->linesize[3] = 0;
+
CSharedLock lock(xvba->m_decoderSection);
{ CSharedLock dLock(xvba->m_displaySection);
@@ -974,14 +984,6 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic)
return -1;
pic->data[0] = (uint8_t*)render;
- pic->data[1] =
- pic->data[2] =
- pic->data[3] = 0;
-
- pic->linesize[0] =
- pic->linesize[1] =
- pic->linesize[2] =
- pic->linesize[3] = 0;
if(pic->reference)
{

0 comments on commit 628f490

Please sign in to comment.