]> git.sesse.net Git - vlc/commitdiff
packetizer/h264.c: fix divition by zero for some streams
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Sat, 23 Apr 2005 22:37:22 +0000 (22:37 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Sat, 23 Apr 2005 22:37:22 +0000 (22:37 +0000)
modules/packetizer/h264.c

index eec3f2b676ee897e92a2c792c712a58fd436ed2b..0f84d798744905cefd9c9cf353fbf7d435164e69 100644 (file)
@@ -630,9 +630,12 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag )
                     w = bs_read( &s, 16 );
                     h = bs_read( &s, 16 );
                 }
-                p_dec->fmt_out.video.i_aspect =
-                    VOUT_ASPECT_FACTOR * w / h * p_dec->fmt_out.video.i_width /
-                    p_dec->fmt_out.video.i_height;
+                if( h != 0 )
+                    p_dec->fmt_out.video.i_aspect =
+                        VOUT_ASPECT_FACTOR * w / h * p_dec->fmt_out.video.i_width /
+                        p_dec->fmt_out.video.i_height;
+                else
+                    p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR;
             }
         }