summaryrefslogtreecommitdiff
path: root/libavcodec/dvbsubdec.c
diff options
context:
space:
mode:
authorIan Caulfield <ian.caulfield@gmx.at>2005-08-14 01:15:27 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-08-14 01:15:27 +0000
commitbf01fb696defe708fde9ec5d21ebad948f70c877 (patch)
treeab9f145f9cb3a8bce3ed9fc92d6c4ce5451d2645 /libavcodec/dvbsubdec.c
parent8341e4e3384aedddd2a515db38b0fbfad95f59bd (diff)
subs.diff fixes a couple of minor bugs in my DVB subtitle decoder, and also fixes a few
problems in the DVD decoder (the palette entries were being read back-to-front, and the timing conversions were slighly off) patch by (Ian Caulfield: imc25, cam ac uk) Originally committed as revision 4520 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dvbsubdec.c')
-rw-r--r--libavcodec/dvbsubdec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 3309e61f37..5504ac29ff 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1310,10 +1310,8 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, uint8_t *buf,
sub->num_rects = ctx->display_list_size;
- if (sub->num_rects == 0)
- return 0;
-
- sub->rects = av_mallocz(sizeof(AVSubtitleRect) * sub->num_rects);
+ if (sub->num_rects > 0)
+ sub->rects = av_mallocz(sizeof(AVSubtitleRect) * sub->num_rects);
i = 0;
@@ -1447,7 +1445,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
return -1;
}
- return 0;
+ return buf_size;
}