avcodec/dvdsubdec: ignore h <= 1 case, to properly decode subtitle
authorPaul B Mahol <onemda@gmail.com>
Sat, 17 Sep 2016 21:18:27 +0000 (23:18 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sun, 18 Sep 2016 13:22:48 +0000 (15:22 +0200)
Fixes #5825. If h == 1, second decode_rle() fails.

Regression since: 3f0a3e9e127d067c5cf65640a44765c1ddd01622.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/dvdsubdec.c

index 19f25f0..b81b481 100644 (file)
@@ -368,7 +368,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
             h = y2 - y1 + 1;
             if (h < 0)
                 h = 0;
-            if (w > 0 && h > 0) {
+            if (w > 0 && h > 1) {
                 reset_rects(sub_header);
 
                 sub_header->rects = av_mallocz(sizeof(*sub_header->rects));