[FFmpeg-devel] avcodec/bintext: Add error message when resolution is too small for font.

Submitted by Oliver Collyer via ffmpeg-devel on April 8, 2019, 10:22 p.m.

Details

Message ID 20190408222210.151114-1-nbowe@google.com
State New
Headers show

Commit Message

Oliver Collyer via ffmpeg-devel April 8, 2019, 10:22 p.m.
---
 libavcodec/bintext.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer April 10, 2019, 8:25 p.m.
On Mon, Apr 08, 2019 at 03:22:10PM -0700, Nikolas Bowe via ffmpeg-devel wrote:
> ---
>  libavcodec/bintext.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

LGTM

thanks

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c
index d85f2c2dd4..49b75c9e27 100644
--- a/libavcodec/bintext.c
+++ b/libavcodec/bintext.c
@@ -93,8 +93,10 @@  static av_cold int decode_init(AVCodecContext *avctx)
             break;
         }
     }
-    if (avctx->width < FONT_WIDTH || avctx->height < s->font_height)
+    if (avctx->width < FONT_WIDTH || avctx->height < s->font_height) {
+        av_log(avctx, AV_LOG_ERROR, "Resolution too small for font.\n");
         return AVERROR_INVALIDDATA;
+    }
 
     return 0;
 }