Skip to content

Commit ec55c08

Browse files
committed
valid values for VASurfaceID is > 0
1 parent fe536e1 commit ec55c08

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/frame.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@ class Frame : public FFWrapperPtr<AVFrame>
265265
bool isComplete() const { return m_isComplete; }
266266

267267
bool isValid() const {
268-
return (!isNull() && (m_raw->data[0] && m_raw->linesize[0]) || ((m_raw->format == AV_PIX_FMT_VAAPI)));
268+
return (!isNull() &&
269+
((m_raw->data[0] && m_raw->linesize[0]) ||
270+
((m_raw->format == AV_PIX_FMT_VAAPI) && ((intptr_t)m_raw->data[3] > 0)))
271+
);
269272
}
270273

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

0 commit comments

Comments
 (0)