Browse Source

jpeg: fix picture release on encoder

Encoders are currently supposed to consume the given picture.
pull/143/head
Alexandre Janniaux 4 years ago
committed by Steve Lhomme
parent
commit
cccc085e30
  1. 3
      modules/codec/jpeg.c

3
modules/codec/jpeg.c

@ -651,6 +651,7 @@ static block_t *EncodeBlock(encoder_t *p_enc, picture_t *p_pic)
block_t *p_block = block_Alloc(p_sys->i_blocksize);
if (p_block == NULL)
{
picture_Release(p_pic);
return NULL;
}
@ -735,6 +736,7 @@ static block_t *EncodeBlock(encoder_t *p_enc, picture_t *p_pic)
p_block->i_buffer = size;
p_block->i_dts = p_block->i_pts = p_pic->date;
picture_Release(p_pic);
return p_block;
@ -751,6 +753,7 @@ error:
free(p_row_pointers);
block_Release(p_block);
picture_Release(p_pic);
return NULL;
}

Loading…
Cancel
Save