diff mbox

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

Message ID 20190408222210.151114-1-nbowe@google.com
State Accepted
Commit dd9907847c0d8a4836c441cfdd58c5ad31f9b819
Headers show

Commit Message

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

Comments

Michael Niedermayer April 10, 2019, 8:25 p.m. UTC | #1
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

[...]
Michael Niedermayer April 25, 2019, 9:33 a.m. UTC | #2
On Wed, Apr 10, 2019 at 10:25:45PM +0200, Michael Niedermayer wrote:
> 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

will apply

[...]
diff mbox

Patch

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;
 }