Merge pull request #5441 from alalek:fix_ffmpeg_frame_creation

This commit is contained in:
Alexander Alekhin 2015-10-06 10:01:39 +00:00
commit 7a4b2e18a7

View File

@ -1130,6 +1130,11 @@ static AVFrame * icv_alloc_picture_FFMPEG(int pix_fmt, int width, int height, bo
#endif #endif
if (!picture) if (!picture)
return NULL; return NULL;
picture->format = pix_fmt;
picture->width = width;
picture->height = height;
size = avpicture_get_size( (AVPixelFormat) pix_fmt, width, height); size = avpicture_get_size( (AVPixelFormat) pix_fmt, width, height);
if(alloc){ if(alloc){
picture_buf = (uint8_t *) malloc(size); picture_buf = (uint8_t *) malloc(size);