Rather than checking if `';base64,'` is anywhere in the string, why not use a regex to be sure the format matches exactly. For example something like this (not tested):

```javascript
if m = /^data:.+\/.+;base64,(.*)$/.exec(src)
  data = new Buffer(m[1], 'base64')
```