summaryrefslogtreecommitdiff
path: root/libavformat/cdg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/cdg.c')
-rw-r--r--libavformat/cdg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/cdg.c b/libavformat/cdg.c
index 54ad17e3b0..e699691925 100644
--- a/libavformat/cdg.c
+++ b/libavformat/cdg.c
@@ -46,9 +46,10 @@ static int read_header(AVFormatContext *s)
avpriv_set_pts_info(vst, 32, 1, 300);
ret = avio_size(s->pb);
- if (ret > 0)
- vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
+ if (ret < 0)
+ return ret;
+ vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
return 0;
}