[vlc-devel] commit: Do not allocate 0x0 region in ffmpeg subtitle decoder. ( Laurent Aimar )

git version control git at videolan.org
Tue Nov 10 20:37:58 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Nov  8 19:44:19 2009 +0100| [c830468dbe7340bfffd0a572e134844c2aa0534f] | committer: Laurent Aimar 

Do not allocate 0x0 region in ffmpeg subtitle decoder.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c830468dbe7340bfffd0a572e134844c2aa0534f
---

 modules/codec/avcodec/subtitle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index 7574e8a..1415f8b 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -183,8 +183,10 @@ void EndSubtitleDec(decoder_t *dec)
  */
 static subpicture_region_t *ConvertRegionRGBA(AVSubtitleRect *ffregion)
 {
-    video_format_t fmt;
+    if (ffregion->w <= 0 || ffregion->h <= 0)
+        return NULL;
 
+    video_format_t fmt;
     memset(&fmt, 0, sizeof(fmt));
     fmt.i_chroma         = VLC_FOURCC('R','G','B','A');
     fmt.i_aspect         = 0;




More information about the vlc-devel mailing list