audiocdsrc: guard aginst overflow
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 10 Apr 2014 10:14:25 +0000 (11:14 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 10 Apr 2014 11:35:03 +0000 (12:35 +0100)
An audio CD may contain about a tenth of the samples 32 bit can
represent, so it doesn't seem likely this will be hit in practice.

Coverity 1139805

gst-libs/gst/audio/gstaudiocdsrc.c

index ebb6ecedcb6ee7bb8ec820902aeea0363e249faf..a384d42dd413456a7632aedc2cf48a53d09400d6 100644 (file)
@@ -519,7 +519,7 @@ gst_audio_cd_src_convert (GstAudioCdSrc * src, GstFormat src_format,
       goto wrong_value;
     }
     src_format = GST_FORMAT_DEFAULT;
-    src_val = src->priv->tracks[src_val].start * SAMPLES_PER_SECTOR;
+    src_val = src->priv->tracks[src_val].start * (gint64) SAMPLES_PER_SECTOR;
   } else if (src_format == sector_format) {
     src_format = GST_FORMAT_DEFAULT;
     src_val = src_val * SAMPLES_PER_SECTOR;