Menu

bug##mp4box to encrypt a mp4 file using AES-CBC of cenc

Help
genshen
2014-05-12
2014-05-12
  • genshen

    genshen - 2014-05-12

    I think this is bug! my code is rv5223, in ismacryp.c I think this function "gf_cenc_encrypt_sample_cbc":
    ret = samp->dataLength % 16;
    if (ret) {
    gf_bs_write_data(cyphertext_bs, buffer, ret);
    }
    if (samp->dataLength >= 16) {
    gf_crypt_encrypt(mc, buffer, samp->dataLength);
    gf_bs_write_data(cyphertext_bs, buffer, samp->dataLength);
    }
    should be modified
    ret = samp->dataLength % 16;
    if (ret) {
    gf_bs_write_data(cyphertext_bs, buffer, ret);
    }
    if (samp->dataLength >= 16) {
    gf_crypt_encrypt(mc, buffer+ret, samp->dataLength-ret);
    gf_bs_write_data(cyphertext_bs, buffer+ret, samp->dataLength-ret);
    }
    thanks

     
  • genshen

    genshen - 2014-05-12

    rv5248 is the same!