ff_alloc_picture: free tables in case of dimension mismatches
Fixes memory corruption In theory this should not be needed but its better to check at one place than to hope 50 other places set the flags correctly
This commit is contained in:
parent
9e73f6d1f9
commit
ee3c3dd523
1 changed files with 5 additions and 0 deletions
|
|
@ -411,6 +411,11 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared)
|
|||
{
|
||||
int i, ret;
|
||||
|
||||
if (pic->qscale_table_buf)
|
||||
if (pic->mbskip_table_buf->size < s->mb_stride * s->mb_height + 2 ||
|
||||
pic->qscale_table_buf->size < s->mb_stride * (s->mb_height + 1) + 1 + s->mb_stride)
|
||||
free_picture_tables(pic);
|
||||
|
||||
if (shared) {
|
||||
assert(pic->f.data[0]);
|
||||
pic->shared = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue