diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index b81c957145..6e26342c82 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -300,10 +300,11 @@ static int capture_screen(CCaptionSubContext *ctx) j++; for (; j < SCREEN_COLUMNS; j++) { + const char *e_tag = "", *s_tag = ""; + if (row[j] == 0) break; - const char *e_tag = "", *s_tag = ""; if (prev_font != font[j]) { switch (prev_font) { case CCFONT_ITALICS: