cdg: Forward error from avio_size() in read_header() function
authorNidhi Makhijani <nidhimj22@gmail.com>
Thu, 10 Jul 2014 08:14:51 +0000 (13:44 +0530)
committerDiego Biurrun <diego@biurrun.de>
Thu, 10 Jul 2014 19:38:54 +0000 (12:38 -0700)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavformat/cdg.c

index 54ad17e..e699691 100644 (file)
@@ -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;
 }