Skip to content

Commit

Permalink
valid values for VASurfaceID is > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-misek committed Nov 5, 2024
1 parent fe536e1 commit ec55c08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ class Frame : public FFWrapperPtr<AVFrame>
bool isComplete() const { return m_isComplete; }

bool isValid() const {
return (!isNull() && (m_raw->data[0] && m_raw->linesize[0]) || ((m_raw->format == AV_PIX_FMT_VAAPI)));
return (!isNull() &&
((m_raw->data[0] && m_raw->linesize[0]) ||
((m_raw->format == AV_PIX_FMT_VAAPI) && ((intptr_t)m_raw->data[3] > 0)))
);
}

operator bool() const { return isValid() && isComplete(); }
Expand Down

0 comments on commit ec55c08

Please sign in to comment.