Bug fix for crash video format conversion in the case that desired video pixel format is already in bgra so no conversion is necessary. Fixes crash for ffv1 encoder.
This commit is contained in:
parent
0076f048f8
commit
74e3b81536
|
@ -949,17 +949,12 @@ static int initVideoStream( const char *codec_name, OutputStream *ost )
|
|||
/* If the output format is not YUV420P, then a temporary YUV420P
|
||||
* picture is needed too. It is then converted to the required
|
||||
* output format. */
|
||||
ost->tmp_frame = NULL;
|
||||
ost->tmp_frame = alloc_picture(AV_PIX_FMT_BGRA, c->width, c->height);
|
||||
|
||||
if (c->pix_fmt != AV_PIX_FMT_BGRA)
|
||||
if (ost->tmp_frame == NULL)
|
||||
{
|
||||
ost->tmp_frame = alloc_picture(AV_PIX_FMT_BGRA, c->width, c->height);
|
||||
|
||||
if (ost->tmp_frame == NULL)
|
||||
{
|
||||
fprintf(stderr, "Could not allocate temporary picture\n");
|
||||
return -1;
|
||||
}
|
||||
fprintf(stderr, "Could not allocate temporary picture\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ost->sws_ctx = sws_getContext(c->width, c->height,
|
||||
|
|
Loading…
Reference in New Issue