Skip to content

Commit a2c8493

Browse files
author
Clement Champetier
committed
Video/AudioFrame: fixed compilation error with msvc
"cannot allocate an array of constant size 0".
1 parent f6467b1 commit a2c8493

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/AvTranscoder/data/decoded/AudioFrame.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ void AudioFrame::allocateAVSample(const AudioFrameDesc& desc)
100100
void AudioFrame::assign(const unsigned char value)
101101
{
102102
// Create the audio buffer
103+
// The buffer will be freed in destructor of based class
103104
const int audioSize = getSize();
104-
unsigned char audioBuffer[audioSize];
105+
unsigned char* audioBuffer = new unsigned char[audioSize];
105106
memset(audioBuffer, value, audioSize);
106107

107108
// Fill the picture

src/AvTranscoder/data/decoded/VideoFrame.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ void VideoFrame::allocateAVPicture(const VideoFrameDesc& desc)
9090
void VideoFrame::assign(const unsigned char value)
9191
{
9292
// Create the image buffer
93+
// The buffer will be freed in destructor of based class
9394
const int imageSize = getSize();
94-
unsigned char imageBuffer[imageSize];
95+
unsigned char* imageBuffer = new unsigned char[imageSize];
9596
memset(imageBuffer, value, imageSize);
9697

9798
// Fill the picture

0 commit comments

Comments
 (0)