Fixed crash when converting damaged subtitles
This commit is contained in:
1 parent
4e0d573c5b
commit
8a730d9972
1 file changed
+2
@@ -320,6 +320,8 @@ void FFInitFFmpeg() {
|
|||||||
|
|
||||||
for (unsigned i = 0; i < subtitle.num_rects; i++) {
|
for (unsigned i = 0; i < subtitle.num_rects; i++) {
|
||||||
AVSubtitleRect *rect = subtitle.rects[i];
|
AVSubtitleRect *rect = subtitle.rects[i];
|
||||||
|
if (rect->w == 0 || rect->h == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
uint32_t *imageData = calloc(rect->w * rect->h * 4, sizeof(uint32_t));
|
uint32_t *imageData = calloc(rect->w * rect->h * 4, sizeof(uint32_t));
|
||||||
memset(imageData, 0, rect->w * rect->h * 4);
|
memset(imageData, 0, rect->w * rect->h * 4);
|
||||||
|
|||||||
Reference in new issue
Block a user