Commit 89006488 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Avcodec: Correctly free the Subtitles structures so it doesn't crash on Win32

Close #3439
parent 9f9f6d11
......@@ -262,7 +262,7 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t
//msg_Err(dec, "SUBS RECT[%d]: %dx%d @%dx%d",
// i, rec->w, rec->h, rec->x, rec->y);
subpicture_region_t *region;
subpicture_region_t *region = NULL;
switch (ffsub->format) {
case 0:
region = ConvertRegionRGBA(rec);
......@@ -276,13 +276,11 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t
*region_next = region;
region_next = &region->p_next;
}
/* Free AVSubtitleRect
* FIXME isn't there an avcodec function ? */
free(rec->pict.data[0]); /* Plane */
free(rec->pict.data[1]); /* Palette */
free(rec);
/* Free AVSubtitleRect */
avpicture_free(&rec->pict);
av_free(rec);
}
free(ffsub->rects);
av_free(ffsub->rects);
return spu;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment