History

avcodec/srtdec: Check ff_htmlmarkup_to_ass() return code

Michael Niedermayer committed 9 years ago

Commit 7b94df21 parent 983e3fb1 file · +5 −4Browse files

Unified · Split

libavcodec/srtdec.c+5−4
@@ -27,7 +27,7 @@ · 26 unmodified lines
27#include "ass.h"27#include "ass.h"
28#include "htmlsubtitles.h"28#include "htmlsubtitles.h"
29 29
30static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,30static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
31 const char *in, int x1, int y1, int x2, int y2)31 const char *in, int x1, int y1, int x2, int y2)
32{32{
33 if (x1 >= 0 && y1 >= 0) {33 if (x1 >= 0 && y1 >= 0) {
@@ -49,7 +49,7 @@ static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, · 15 unmodified lines
49 }49 }
50 }50 }
51 51
52 ff_htmlmarkup_to_ass(avctx, dst, in);52 return ff_htmlmarkup_to_ass(avctx, dst, in);
53}53}
54 54
55static int srt_decode_frame(AVCodecContext *avctx,55static int srt_decode_frame(AVCodecContext *avctx,
@@ -74,8 +74,9 @@ static int srt_decode_frame(AVCodecContext *avctx, · 18 unmodified lines
74 74
75 av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED);75 av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED);
76 76
77 srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);77 ret = srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);
78 ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);78 if (ret >= 0)
79 ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);
79 av_bprint_finalize(&buffer, NULL);80 av_bprint_finalize(&buffer, NULL);
80 if (ret < 0)81 if (ret < 0)
81 return ret;82 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t