Skip to content

Commit a1992c0

Browse files
author
Clement Champetier
committed
AvInputVideo: check decodedSize
* Return false as status of decoding if size of frame is 0.
1 parent b323fbc commit a1992c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/AvTranscoder/essenceStream/AvInputVideo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ bool AvInputVideo::readNextFrame( Frame& frameBuffer )
108108
VideoFrame& imageBuffer = static_cast<VideoFrame&>( frameBuffer );
109109

110110
size_t decodedSize = avpicture_get_size( (AVPixelFormat)_frame->format, _frame->width, _frame->height );
111+
if( ! decodedSize )
112+
return false;
113+
111114
if( imageBuffer.getBuffer().size() != decodedSize )
112115
imageBuffer.getBuffer().resize( decodedSize );
113116

0 commit comments

Comments
 (0)