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 ...@@ -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", //msg_Err(dec, "SUBS RECT[%d]: %dx%d @%dx%d",
// i, rec->w, rec->h, rec->x, rec->y); // i, rec->w, rec->h, rec->x, rec->y);
subpicture_region_t *region; subpicture_region_t *region = NULL;
switch (ffsub->format) { switch (ffsub->format) {
case 0: case 0:
region = ConvertRegionRGBA(rec); region = ConvertRegionRGBA(rec);
...@@ -276,13 +276,11 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t ...@@ -276,13 +276,11 @@ static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t
*region_next = region; *region_next = region;
region_next = &region->p_next; region_next = &region->p_next;
} }
/* Free AVSubtitleRect /* Free AVSubtitleRect */
* FIXME isn't there an avcodec function ? */ avpicture_free(&rec->pict);
free(rec->pict.data[0]); /* Plane */ av_free(rec);
free(rec->pict.data[1]); /* Palette */
free(rec);
} }
free(ffsub->rects); av_free(ffsub->rects);
return spu; 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