- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I found a minior bug in UMC::H264VideoEncoder, the example is modify from http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/
void EncodeStream(Ipp8u *cYUVData, int imgWidth, int imgHeight, int frameNumber,
Ipp8u *cVideoData,int &VideoDataSize )
{
UMC::Status status;
UMC::MediaData DataOut; UMC::VideoData DataIn;
int FrameSize;
UMC::H264EncoderParams Params;
UMC::H264VideoEncoder *H264Encoder;
H264Encoder = new UMC::H264VideoEncoder;
Params.key_frame_controls.method=1;
Params.info.clip_info.height=imgHeight;
Params.info.clip_info.width=imgWidth;
Params.info.bitrate = 1000000;
Params.numThreads = 1;
if((status = H264Encoder->Init(&Params))!=UMC::UMC_OK)
return;
FrameSize = imgWidth*imgHeight*3/2;
DataIn.Init(imgWidth,imgHeight,UMC::YV12,8);
DataIn.SetBufferPointer(cYUVData,FrameSize);
DataIn.SetDataSize(FrameSize);
DataOut.SetBufferPointer(cVideoData,MAXVIDEOSIZE);
VideoDataSize=0;
int nEncodedFrames=0;
while ( nEncodedFrames < frameNumber)
{
status = H264Encoder->GetFrame(&DataIn, &DataOut);
if (status == UMC::UMC_OK)
{
nEncodedFrames++;
VideoDataSize+=DataOut.GetDataSize();
DataOut.MoveDataPointer(DataOut.GetDataSize());
cYUVData+=FrameSize;
DataIn.SetBufferPointer(cYUVData,FrameSize);
DataIn.SetDataSize(FrameSize);
}
}
H264Encoder->Close();
delete H264Encoder;
return;
}
then the program would crash in excuting delete H264Encoder, on H264ENC_MAKE_NAME in umc_h264_enc_cpb_tmp1.cpp.h for accessing a freed memory.
it is becouse the m_pEncoder_8u_16s is not been set as NULL.
thank you.
I found a minior bug in UMC::H264VideoEncoder, the example is modify from http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/
void EncodeStream(Ipp8u *cYUVData, int imgWidth, int imgHeight, int frameNumber,
Ipp8u *cVideoData,int &VideoDataSize )
{
UMC::Status status;
UMC::MediaData DataOut; UMC::VideoData DataIn;
int FrameSize;
UMC::H264EncoderParams Params;
UMC::H264VideoEncoder *H264Encoder;
H264Encoder = new UMC::H264VideoEncoder;
Params.key_frame_controls.method=1;
Params.info.clip_info.height=imgHeight;
Params.info.clip_info.width=imgWidth;
Params.info.bitrate = 1000000;
Params.numThreads = 1;
if((status = H264Encoder->Init(&Params))!=UMC::UMC_OK)
return;
FrameSize = imgWidth*imgHeight*3/2;
DataIn.Init(imgWidth,imgHeight,UMC::YV12,8);
DataIn.SetBufferPointer(cYUVData,FrameSize);
DataIn.SetDataSize(FrameSize);
DataOut.SetBufferPointer(cVideoData,MAXVIDEOSIZE);
VideoDataSize=0;
int nEncodedFrames=0;
while ( nEncodedFrames < frameNumber)
{
status = H264Encoder->GetFrame(&DataIn, &DataOut);
if (status == UMC::UMC_OK)
{
nEncodedFrames++;
VideoDataSize+=DataOut.GetDataSize();
DataOut.MoveDataPointer(DataOut.GetDataSize());
cYUVData+=FrameSize;
DataIn.SetBufferPointer(cYUVData,FrameSize);
DataIn.SetDataSize(FrameSize);
}
}
H264Encoder->Close();
delete H264Encoder;
return;
}
then the program would crash in excuting delete H264Encoder, on H264ENC_MAKE_NAME in umc_h264_enc_cpb_tmp1.cpp.h for accessing a freed memory.
it is becouse the m_pEncoder_8u_16s is not been set as NULL.
thank you.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting that issue. We will fix the problem.
Regards,
Vladimir
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Gaiger,
The fix has been included into 7.0.2 release. Thanks for your report.
Thanks,
Chao
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page